Skip to content

Commit

Permalink
HID: logitech-dj: Fix memory leak in logi_dj_recv_switch_to_dj_mode()
Browse files Browse the repository at this point in the history
[ Upstream commit ce3af2e ]

Fix a memory leak on logi_dj_recv_send_report() error path.

Fixes: 6f20d32 ("HID: logitech-dj: Fix error handling in logi_dj_recv_switch_to_dj_mode()")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JoseExposito authored and gregkh committed Jul 5, 2024
1 parent cf34f8f commit caa9c9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/hid/hid-logitech-dj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,10 @@ static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
*/
msleep(50);

if (retval)
if (retval) {
kfree(dj_report);
return retval;
}
}

/*
Expand Down

0 comments on commit caa9c9a

Please sign in to comment.