]> git.baikalelectronics.ru Git - kernel.git/commit
ptp: ocp: Fix the error handling path for the class device.
authorJonathan Lemon <jonathan.lemon@gmail.com>
Thu, 5 Aug 2021 19:52:43 +0000 (12:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Aug 2021 09:41:27 +0000 (10:41 +0100)
commitff2f8d16724de26f3cc7d84f9a617c100ae848a5
tree1b0bb70789aca4c8a7df7686401ad69c2f2bbbd4
parentba234c5fb2056928ad5081f596196ff2653a6fb9
ptp: ocp: Fix the error handling path for the class device.

Move the put_device() call to the error handling path, so the
device is released after the .release callback, avoiding a
use-after-free.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_ocp.c