Skip to content

Commit

Permalink
mfd: dln2: Fix double put in dln2_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 759c409 ]

The dln2_free() already contains usb_put_dev(). Therefore,
the redundant usb_put_dev() before dln2_free() may lead to
a double free.

Fixes: 96da8f1 ("mfd: dln2: Fix memory leak in dln2_probe()")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20230925024134.9683-1-dinghao.liu@zju.edu.cn
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dinghaoliu authored and gregkh committed Nov 20, 2023
1 parent 74cc5cb commit 6413a80
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/mfd/dln2.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,6 @@ static int dln2_probe(struct usb_interface *interface,
dln2_stop_rx_urbs(dln2);

out_free:
usb_put_dev(dln2->usb_dev);
dln2_free(dln2);

return ret;
Expand Down

0 comments on commit 6413a80

Please sign in to comment.