summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-01-13 16:41:22 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-08 15:19:03 +0900
commit02afa3304595cca65d08560cd087d88ec7155906 (patch)
treede8ec518d5bfcba4fbedd2e99d7dcad2f4daf0e0
parentf362304350c0afd1c2df5b819f2f8d31949e0dd4 (diff)
downloadlinux-3.10-02afa3304595cca65d08560cd087d88ec7155906.tar.gz
linux-3.10-02afa3304595cca65d08560cd087d88ec7155906.tar.bz2
linux-3.10-02afa3304595cca65d08560cd087d88ec7155906.zip
usb: gadget: FunctionFS: dereference ffs_dev conditionally
ffs_dev->ffs_release_dev_callback should be accessed only if ffs_dev is not NULL. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
-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 b70b9be406f..1f8629aaaaf 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -2592,11 +2592,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();
}