summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_fs.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-01-13 19:49:35 +0400
committerFelipe Balbi <balbi@ti.com>2014-02-18 20:52:55 +0400
commitea365922f9eb2fb6fc0486f521748f19bfd5c502 (patch)
treed3eee34aa989a92453b15af6a3ec78d11f704738 /drivers/usb/gadget/f_fs.c
parentde9db572fe5135bb2cf5bb2d8520f99a56b21d9b (diff)
downloadlinux-ea365922f9eb2fb6fc0486f521748f19bfd5c502.tar.xz
usb: gadget: FunctionFS: dereference ffs_dev conditionally
ffs_dev->ffs_release_dev_callback should be accessed only if ffs_dev is not NULL. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_fs.c')
-rw-r--r--drivers/usb/gadget/f_fs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 306a2b52125c..78333f033e90 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -2590,11 +2590,12 @@ static void ffs_release_dev(struct ffs_data *ffs_data)
ffs_dev_lock();
ffs_dev = ffs_data->private_data;
- if (ffs_dev)
+ if (ffs_dev) {
ffs_dev->mounted = false;
-
- if (ffs_dev->ffs_release_dev_callback)
- ffs_dev->ffs_release_dev_callback(ffs_dev);
+
+ if (ffs_dev->ffs_release_dev_callback)
+ ffs_dev->ffs_release_dev_callback(ffs_dev);
+ }
ffs_dev_unlock();
}