From patchwork Wed Feb 24 10:57:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8404871 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AED8C0553 for ; Wed, 24 Feb 2016 10:57:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2815F202BE for ; Wed, 24 Feb 2016 10:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57163202B8 for ; Wed, 24 Feb 2016 10:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924AbcBXK5b (ORCPT ); Wed, 24 Feb 2016 05:57:31 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:33425 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbcBXK5V (ORCPT ); Wed, 24 Feb 2016 05:57:21 -0500 Received: by mail-pf0-f178.google.com with SMTP id q63so11192429pfb.0; Wed, 24 Feb 2016 02:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wcIWiXNo3OV8PrdhGDM+paC5yIAe06ssCd9Hh3F9NKI=; b=yc3CZ8pf+V1zlASdcK2QzpQEdegOhT4gAtqfbh16NcTdiUswV/4NeMD6Qctah+aTK+ RkYhl0HTanoMI0Va/Yz89HZv9PW/Ts069kd4p+8bonFUWnOaF/Wq9RSTZI4aQ6z8Vbr4 JGnz/nFwa0qxs8J2uYmTOtQFU9Axi9peRBNVu2s0R5ju1JhTipcAI4RKoKueWf628cgY iful3AjA4vCEmKXY0lUDusslSUrai26yCPYARw9TYQwyjtDSEt+3onJRnMeEfwa9G6FU 9ASZCy0SaehmxwE89p5gO9z4MKz02MZRLqnm7H9TbNPGbUVIiDpOIu4K44MMLMyA47vQ vidw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wcIWiXNo3OV8PrdhGDM+paC5yIAe06ssCd9Hh3F9NKI=; b=lpMgHiujEOcnWR0pNSWc/30AEPmmv1TM65T8xSHrWqtwi0WBumbZDNjY+c7PF8I8fU sULw84uzPAhPHhlnWxufgD+Qib9sjtFv/jjhl+SBNnRBK1tGdo4uyb4ZyZWYjJFI6Qz2 zQDXU1jvhCEHn/mLcwZlbPAI/BwNU+ikImlCIwTqkeavW4Q+SE+xyG7FYcdnj19bPaVm toXTPwzsuF0WlXwntV6LjWZHFXzw2c4+rEkw2uZSZrv/xeln9ZqrLNOC8vVu8d3Vu04c wTk1z2QbvxNWIhX2NiQXXUT7UHSsj5Jf+YhV1NjEUBHfIXIG3XJXzLCZeoy2uNws7kTf 4kTA== X-Gm-Message-State: AG10YOQDhFyt0AhCQAAx+jUb1RDjLnbS/Rcdl9U4MSoIdpUlbZEuKMg4U6zTuyI8i3q0fQ== X-Received: by 10.98.68.212 with SMTP id m81mr53475028pfi.135.1456311440579; Wed, 24 Feb 2016 02:57:20 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([14.195.230.182]) by smtp.gmail.com with ESMTPSA id s197sm4150329pfs.62.2016.02.24.02.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 02:57:19 -0800 (PST) From: Sudip Mukherjee To: "Martin K. Petersen" Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] imm: check parport_claim Date: Wed, 24 Feb 2016 16:27:11 +0530 Message-Id: <1456311431-18521-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/scsi/imm.c | 7 ++++--- 1 file 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); }