From d08abd703140170dbd8611117395cccb23e4ce8b Mon Sep 17 00:00:00 2001 From: Martin Bachem Date: Wed, 19 Sep 2007 05:09:28 +0000 Subject: [PATCH] fixes a check-after-use spotted by the Coverity checker (Signed-off-by: Adrian Bunk ) --- drivers/isdn/hisax/hfc_usb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index 6993a79f..6d3ea252 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -1520,19 +1520,21 @@ hfc_usb_disconnect(struct usb_interface hfcusb_data *context = usb_get_intfdata(intf); int i; + if (!context) + return; + handle_led(context, LED_POWER_OFF); schedule_timeout((10 * HZ) / 1000); - + printk(KERN_INFO "HFC-S USB: device disconnect\n"); context->disc_flag = 1; usb_set_intfdata(intf, NULL); - if (!context) - return; + if (timer_pending(&context->t3_timer)) del_timer(&context->t3_timer); if (timer_pending(&context->t4_timer)) del_timer(&context->t4_timer); - + /* tell all fifos to terminate */ for (i = 0; i < HFCUSB_NUM_FIFOS; i++) { if (context->fifos[i].usb_transfer_mode == USB_ISOC) {