diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-02-24 10:57:11 (GMT) |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-02-26 02:10:53 (GMT) |
commit | 9ffeca3e576b9f8b18071ca03f7562d198c2f68b (patch) | |
tree | d57c21f1b8442f3b79e4fe07c575b9864972821d /drivers/scsi/imm.c | |
parent | 797150b98a34a27356195d5888c8eac0e2cc6b65 (diff) | |
download | linux-9ffeca3e576b9f8b18071ca03f7562d198c2f68b.tar.xz |
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 <sudip.mukherjee@codethink.co.uk>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/imm.c')
-rw-r--r-- | drivers/scsi/imm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c index f8b88fa..9164ce12 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); } |