usb: gadget: Dereference i_bdev of inode only for block device
If a storage device is not a block device fsg_lun_open() and
fsg_lun_close() still dereference i_bdev pointer from inode.
This results into NULL pointer dereference. Hence fix this by
moving i_bdev dereference under NULL check in fsg_lun_open()
and add NULL check for i_bdev in fsg_lun_close().
CRs-Fixed: 782787
Change-Id: Ia045d80464fce9e16effacbff5f35d5d8627b06f
Signed-off-by:
Hemant Kumar <hemantk@codeaurora.org>
Loading
Please register or sign in to comment