: Fix possible NULL pointer derefrence
PATCH 1/1 : Fix possible NULL pointer derefrence
From: Manjeet Pawar <[email protected]>
Subject: [PATCH] testcases/kernel/device-drivers/usb/tusb/tusb.c: Fix possible NULL pointer derefrence
pdev was accessed before its NULL check, this patch fixes this.
Signed-off-by Manjeet Pawar <[email protected]>
Signed-off-by Yogesh Gaur <[email protected]>
--- testcases/kernel/device-drivers/usb/tusb/tusb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/device-drivers/usb/tusb/tusb.c +3 -2
@@ -386,14 +386,15 @@ static int test_hcd_probe()int rc;struct usb_hcd *hcd =NULL ;struct pci_dev *pdev = ltp_usb.pdev; -struct pci_device_id *id = - (struct pci_device_id *)pdev->driver->id_table; +struct pci_device_id *id =NULL ;if (!pdev) {printk ("tusb: pdev pointer not set\n" );return 1 ; } + id = (struct pci_device_id *)pdev->driver->id_table; +if (!id || !id->driver_data) {printk ("tusb: id_table not set\n" );return 1 ;
Signature · 8 lines
1.7.9.5 ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Pushed, thanks.
Signature · 8 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list