diff mbox

imm: check parport_claim

Message ID 1456311431-18521-1-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Sudip Mukherjee Feb. 24, 2016, 10:57 a.m. UTC
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>
---
 drivers/scsi/imm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Matthew R. Ochs Feb. 24, 2016, 1:40 p.m. UTC | #1
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Feb. 26, 2016, 2:11 a.m. UTC | #2
>>>>> "Sudip" == Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:

Sudip> parport_claim() can fail and we should be checking if we were
Sudip> able to claim the port.

Applied to 4.6/scsi-queue.
diff mbox

Patch

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);
 }