diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2018-09-19 02:25:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-20 14:16:14 +0300 |
commit | 46216506ceacc36eea7535c4a72b77b38fe4b664 (patch) | |
tree | 04a401b9e6f0b2b4bfbae1c16c8a8768ad58587a /drivers/usb/phy/phy-mxs-usb.c | |
parent | 3df0e240caba641e0d70640e3baf34d34c105176 (diff) | |
download | linux-46216506ceacc36eea7535c4a72b77b38fe4b664.tar.xz |
usb: host: fotg2: Fix potential NULL dereference
There is code in the .remove() hook to handle the drvdata
being NULL, for good reasons: it is never set, so it will
always be NULL. As I moved code around, static checkers
start complaining.
Instead of this, make sure to always set it on successful
probe so we can always dereference it on the remove path.
Use the platform_device_[set|get]_drvdata() since this is
a platform device.
Fixes: ffa8a31b5b3b ("usb: host: fotg2: add silicon clock handling")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/phy/phy-mxs-usb.c')
0 files changed, 0 insertions, 0 deletions