Received: by 10.223.164.202 with SMTP id h10csp599621wrb; Fri, 17 Nov 2017 05:49:51 -0800 (PST) X-Google-Smtp-Source: AGs4zMbZPVfGgeVyjY2ZPajxqjiJ3kT6NO5LZmeQq2BstEMrk/ptCaH0hyZAWSHHK93h1PhmGVMb X-Received: by 10.84.213.9 with SMTP id f9mr5155838pli.76.1510926590974; Fri, 17 Nov 2017 05:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510926590; cv=none; d=google.com; s=arc-20160816; b=GPLg0FrBPPoAgnPELC7N8pIFg5vr5iwE3h3BKjZwcagQ+25dpdvp3AsKhiifY3siB/ K2H+rodgNhylLvL2Kc1kk+34vZBAJ2B+VfgQUyC7m4XTuJwA9w3jfTjK0qAtX1jtJhcW hDEr1PLQdx2M+fy8h5hbRgvydBKl9Idw8H2efi8h7Pw2cWJw4XCfAso1ufo5ISCdIbWE vQf6GRO5nkUwb+GRJca2G8rq5mw22C9WemREpDmlyb3uGxzOvSqPJSLc5wdE89b+C3s/ Imhvabl4IFVCm64O0TRnLWZSE4fLqAje3nKF27lIkBHmXCWN6bMtqrAWTWIc+qTBLaWz h+Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=js6mG8upfAVnjy/s/sHODIVnoV3devQDsfxkpHK5BGs=; b=aN5s6xTgIH8JIDAS1hsliVEWHR6TD1qZ+sR/7aufkV733qeXFxX9dTZ12djq0gGNXO En3JcmA92Lqnw/SqJB4sohAMh2izxjlEz2croLqi+afzzHWDz80xVax0QFkEwT6dxRLD l/3++gJ9SF9W0T+fbl7RzBxMiP5K3MwmcGzSoCsuQP2Y7KJuJacJ2ddZJJqGmoXjW/Md u4HClRfB4PnyRqWjS/htjW3424S0odKzwgpfIVL6E1k8c1MCjlbU1YcCM08re6olETiM vJNIWZqLQcB96rerbLXLzLqygH5odkCNumZoaYhMhEcqQJbtMz/olIsALGf2Y5HeRzuM 4Uhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FgaPMyfg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z88si2871288plh.687.2017.11.17.05.49.35; Fri, 17 Nov 2017 05:49:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FgaPMyfg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933722AbdKQGg2 (ORCPT + 91 others); Fri, 17 Nov 2017 01:36:28 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:46457 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933699AbdKQGgM (ORCPT ); Fri, 17 Nov 2017 01:36:12 -0500 Received: by mail-it0-f66.google.com with SMTP id r127so2864579itb.5 for ; Thu, 16 Nov 2017 22:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=js6mG8upfAVnjy/s/sHODIVnoV3devQDsfxkpHK5BGs=; b=FgaPMyfg3GcehyB9CnVwD7tRkNgBIVU7YLb0rbP4a9z5CMREz27VbGt2k7zPnx+KWn 6/UYqiNGSZRlGaoBltp7Vdp2YcB3GAKdUlokE0mAWlrQMMsyAzIZIJraEKwPwt0e+I53 oNKeGUDZRIt52dtG0Gq3U/6YP4QKnApvPDfI+UcgDLpmWoj9Z08kRWI/V/JIX4JGW1n3 SrntuLpzeYN/gEUZef7Dp3+83/UVgf4GsOWPgImR9U+yjCDFVQJ841qSa4XCTiTTNqSN aJsG/hZbKnt/YC20jKQkwp9fci7kJEjvPlFUMzeESkU/R8HaStCyPT/9bFe1n9aWt2/b O9IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=js6mG8upfAVnjy/s/sHODIVnoV3devQDsfxkpHK5BGs=; b=TaV4X9W4a6wxZdIKvGtPOGz7i/pYHSCmnoHEPF64vDsRXOUSDFIw8zNss3qDYiAFc6 H0VkNHWFukI78LLqvPLRcH1hmMRXkhFKzSncb/QhnJSmlh4gc+WmeTxTu27F8wnDrmpt NdNyNFaIPb5TTBcn1mUggZGzt+yOxxgW14jiLorfF5ngXx0cdfrNMBFFoV7grvDyPJoj BVy0cxST9e44GZloNAqRMnyIWFw2ZvC1VP/OhsAGVSt4Cfmpq5oQzgv6ijY35hGqgeW3 8V1otNVso49AZgXICy5pgeY6cBuQNuS3J5PkhoSvnJsmWkXFktsoIt132k27U2FaFiKB sURg== X-Gm-Message-State: AJaThX5yW0k7HS7bS8Ph6adQXyAbsXGmtiuqOKlgP9qF4je6vz61M2J+ pvwOu9IXpKnwyc/6Nr1QdyETuQ== X-Received: by 10.36.175.17 with SMTP id t17mr5580824ite.66.1510900572235; Thu, 16 Nov 2017 22:36:12 -0800 (PST) Received: from [192.168.0.103] ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id 23sm1341315iot.58.2017.11.16.22.36.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Nov 2017 22:36:10 -0800 (PST) Subject: Re: [PATCH] staging: comedi: ni_atmio: Handle return value of pnp_* To: Ian Abbott , hsweeten@visionengravers.com, gregkh@linuxfoundation.org References: <35855327607952b24d97e7f7374a1115f400dd8c.1510806666.git.arvind.yadav.cs@gmail.com> Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org From: arvindY Message-ID: <5A0E8357.3070306@gmail.com> Date: Fri, 17 Nov 2017 12:06:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, On Thursday 16 November 2017 07:27 PM, Ian Abbott wrote: > On 16/11/17 04:32, Arvind Yadav wrote: >> pnp_irq() and pnp_port_start() can fail here and we must check >> its return value. >> >> Signed-off-by: Arvind Yadav >> --- >> drivers/staging/comedi/drivers/ni_atmio.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/staging/comedi/drivers/ni_atmio.c >> b/drivers/staging/comedi/drivers/ni_atmio.c >> index 2d62a8c..dead159 100644 >> --- a/drivers/staging/comedi/drivers/ni_atmio.c >> +++ b/drivers/staging/comedi/drivers/ni_atmio.c >> @@ -308,6 +308,9 @@ static int ni_atmio_attach(struct comedi_device >> *dev, >> iobase = pnp_port_start(isapnp_dev, 0); >> irq = pnp_irq(isapnp_dev, 0); >> + if (irq == -1 || !iobase) >> + return -ENOMEM; >> + >> comedi_set_hw_dev(dev, &isapnp_dev->dev); >> } >> > > Can they fail here? ni_isapnp_find_board() has already checked they > are valid. Yes, you are right. It will not fail. ~arvind From 1584239579366473354@xxx Thu Nov 16 16:09:57 +0000 2017 X-GM-THRID: 1584195855030414163 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread