mmc: core: Fix possible NULL pointer dereference

Add necessary sanity checks to fix possible NULL pointer
deference within function mmc_suspend_host().

CRs-fixed: 566915
Change-Id: Ia58fbe0f0b901a4c9775b730c6ac35436cb06d5d
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
usb: gadget: Fix invalid pointer access in rndis_free_response

Fix code quality issues found by the automatic checking tool.
Verify that act is not NULL before accessing it in rndis_free_response.

CRs-Fixed: 566927
Change-Id: Id9c732669c64ef6f28e26ed660acb434bb1396a5
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
usb: gadget: limit the input string size in fsg_show_file

Fix code quality issues found by the automatic checking tool.
Limit the input string size in fsg_show_file for safe usage of memmove

CRs-Fixed: 566927
Change-Id: I0feed4877c0d8075460e7dd75e01967a68ce9db3
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
usb: usb_bam: Fix issue for not checking NULL returned value

Ensure to correctly check the right pointer returned
from a call to function platform_get_resource_byname()
in order to prevent accessing this pointer afterwards
in case this pointer is NULL.

Change-Id: I8f6ba2944a4c60d2b4e668686c8bf7bc2640f46b
CRs-Fixed: 535640
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
Signed-off-by: Lena Salman <esalman@codeaurora.org>
usb: gadget: Validate the port number in grmnet_ctrl_smd_port_alloc

Fix code quality issues found by the automatic checking tool.
Verify that port number is within the max port limit before setting it
in grmnet_ctrl_smd_port_alloc.

CRs-Fixed: 566927
Change-Id: Iecc50a98c4e32bd8800ea63de0ccb8aecda78090
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
usb: gadget: Check for NULL ptr before call to destoy_wq

Fix code quality issues found by the automatic checking tool.
We now check if ptr is not NULL before calling destroy_workqueue.

CRs-Fixed: 566927
Change-Id: I2525711816f845dfaa7fd6c61e8918ab7f8d34f0
Signed-off-by: Lena Salman <esalman@codeaurora.org>
usb: host: Verify sg before accessing it in qh_urb_transaction

Fix code quality issues found by the automatic checking tool.
Verify safe access to sg in qh_urb_transaction.

Change-Id: I6ce40e8548449aebd628c72bc2b9cda1b2861ba9
CRs-Fixed: 566927
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
usb: gadget: ci13xxx_udc: Access dev only after NULL check

Fix various code quality issues found by the automatic checking tool.
We now access dev fields only after we verify it's not NULL.

Change-Id: I5c43090049437b88941c72de96defdc36368fca1
CRs-Fixed: 566927
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Lena Salman <esalman@codeaurora.org>
usb: gadget: Fix ep_disable on the right eps

Fix the error of disabling the opposite endpoints and
disable the correct ones.

Change-Id: I6edc0ae366f26e90105638fb8437c402f123128f
CRs-Fixed: 566927
Signed-off-by: Lena Salman <esalman@codeaurora.org>
usb: host: Fix array access to a non verified index

Fix code quality issues found by the automatic checking tool,
that can cause out of bound access to the port_status and hostpc arrays.
Verify wIndex before accessing the arrays in this index.

Change-Id: Iec7b7b6b66a318e4e97b23ce243e7a128dbf795a
CRs-Fixed: 566927
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Lena Salman <esalman@codeaurora.org>
Merge "usb: gadget: Fix invalid pointer access in rndis_free_response"
Merge "usb: gadget: limit the input string size in fsg_show_file"
Merge "usb: gadget: Check for NULL ptr before call to destoy_wq"
Merge "usb: host: Fix array access to a non verified index"
Merge "usb: usb_bam: Fix issue for not checking NULL returned value"
Merge "usb: gadget: Validate the port number in grmnet_ctrl_smd_port_alloc"
Merge "usb: gadget: Fix ep_disable on the right eps"
Merge "usb: gadget: ci13xxx_udc: Access dev only after NULL check"
Merge "usb: host: Verify sg before accessing it in qh_urb_transaction"
Merge "mmc: core: Fix possible NULL pointer dereference"