From: Sudip Mukherjee Date: Wed, 24 Feb 2016 10:57:11 +0000 (+0530) Subject: imm: check parport_claim X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9ffeca3e576b9f8b18071ca03f7562d198c2f68b;p=openwrt%2Fstaging%2Fblogic.git imm: check parport_claim parport_claim() can fail and we should be checking if we were able to claim the port. Signed-off-by: Sudip Mukherjee Reviewed-by: Matthew R. Ochs Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index f8b88fa78e62..9164ce1249c1 100644 --- a/drivers/scsi/imm.c +++ b/drivers/scsi/imm.c @@ -77,9 +77,10 @@ static void imm_wakeup(void *ref) spin_lock_irqsave(&arbitration_lock, flags); if (dev->wanted) { - parport_claim(dev->dev); - got_it(dev); - dev->wanted = 0; + if (parport_claim(dev->dev) == 0) { + got_it(dev); + dev->wanted = 0; + } } spin_unlock_irqrestore(&arbitration_lock, flags); }