Skip to content

Commit

Permalink
usb: gadget: FunctionFS: dereference ffs_dev conditionally
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrzej Pietrasiewicz authored and Felipe Balbi committed Feb 18, 2014
1 parent de9db57 commit ea36592
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit ea36592

Please sign in to comment.