diag : Potential Null pointer dereference of driver

Currently there is no check present for the driver structure
whether it is null or not. Thus it may lead to null pointer
dereference. This patch fix that possibility.

Change-Id: I66aac8711b5ec279b2ba79074464fce7f28e48f3
Crs-fixed: 566898
Signed-off-by: Katish Paran <kparan@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: 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: 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: Set size only after validating pointer is valid

Fix code quality issues found by the automatic checking tool.
We now set the size after validating the pointer is valid.

CRs-Fixed: 566927
Change-Id: I2e82cd06fbf6a1630adb487dd11a08556b70216f
Signed-off-by: Danny Segal <dsegal@codeaurora.org>
Signed-off-by: Lena Salman <esalman@codeaurora.org>
msm: tsens8960: Fix NULL pointer dereference

Fix the dereferencing of pointer problem by
checking NULL before use.

CRs-Fixed: 566924
Change-Id: Id5cb119b0293de808d691ac710fc4071ac7719dc
Signed-off-by: Dipen Parmar <dipenp@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 "diag : Potential Null pointer dereference of driver"
Merge "msm: tsens8960: Fix NULL pointer dereference"
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: 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"