Received: by 10.223.164.202 with SMTP id h10csp1431077wrb; Wed, 15 Nov 2017 20:34:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMbD26iuk75dwjD04jLgUC3GERM7dw5cocDyaxa5egWHIBR0hUpON51TR7dj0SgyeBWmDpVr X-Received: by 10.101.64.11 with SMTP id f11mr415624pgp.217.1510806898789; Wed, 15 Nov 2017 20:34:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510806898; cv=none; d=google.com; s=arc-20160816; b=mmRjTExiXNHSzIAFkILseRu/cjcXxbubbpVKDi8uijRoXZ8pjvDIG2PpDh/aYC1Wdd lxV/o7//OBM1hcq+oxzr6ccMwoNpMNtpmMh18kajmNLl2U4clvDxR2qrM2NOIfJcro53 ry4pZvpgfjPNavmyq9BX8Fu5uTB+pSq1uhlJcfUWVKjiepMRwIFhDGpyPecj0s/QMzdA Nz/+VrlpEvt/UO0G28W6gxSvsTvIcclnN7/C/nux2jWgcT9juH7QRZW8dR+shLcj7ez4 vHIydR5PyMNBgwVwXybMG/vwO+rTDwyJAcmMZl7H67rANEjQnGL04W50APfviNry1TFq OYSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=xlJvyMsVW+uGBpiQJSsHSm4CTKRSpW0YPmD5esUD64c=; b=yQsoTSrewb3cGer1DGCFj5PT1QuQvGgvbVvUImROL8+V67U63sRvyw6YD10F6XBVGp jhyYR6G7AvFA6Ouzhe1Pt9Nynkna/TV8XT7AMb2uwlp71+8MRkvQCbAQXYgxyorFx5Bm hqgo6hsYAqzHMCv/HDSP1G71fWJ2FnUM8vRrv3SWXQzWYTnhE/VvwCz+KcdPv/dHUFaM IuCKjbdJAnaDcivsp8jqxRlA3UPDAQLZJ3ZFC9j0bL9m3WzOEELRD4YlmNpXakwcvXGv bWWRLM+y0LK+rGtZRh+TLZgZxVEbtvQABUX3lZx7sa2whu/uR2++uYT3lQuVgq2/9Cjf Z7aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bxyiUl17; 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 w24si190998plq.427.2017.11.15.20.34.46; Wed, 15 Nov 2017 20:34:58 -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=bxyiUl17; 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 S932931AbdKPEdm (ORCPT + 89 others); Wed, 15 Nov 2017 23:33:42 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:54646 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932612AbdKPEdb (ORCPT ); Wed, 15 Nov 2017 23:33:31 -0500 Received: by mail-pf0-f196.google.com with SMTP id n89so18715468pfk.11 for ; Wed, 15 Nov 2017 20:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xlJvyMsVW+uGBpiQJSsHSm4CTKRSpW0YPmD5esUD64c=; b=bxyiUl17Bu+v2+iIDD++Ovp1DHZPFWI8SPtJ5oiYajmI5fbvDh5s9sklhKMcY7ux4e A+g1ZrpEZpTP2bReQh1KxxCYQE0y45h19eYoWTKObM2WcVVcYRi8Ak+uKJH8hs7/ZU6C Jtx167+pL6s4MzsxNNAy8Yt6HC8pt5paaZsdLofuzWAPBbUvHwThUSddv3xDLYexFtY/ 3H6vne0nvugGHi7h32AX750usOA334HHN8QQjJCYd2gGqenlGVLRFAONaP8FJMRmDQqE pfW8DbQXWr+mWQi28YR4a8VtUs6nOWnjXnSF2P7jV+H8qP6p25k4sST8GLp836/mJRY0 R5tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xlJvyMsVW+uGBpiQJSsHSm4CTKRSpW0YPmD5esUD64c=; b=gUOXPLPBqV0lT46K1TcyaSZO11MZJ1407cn5qkWtUd3G0T0Sie2A9nrbfEa9REhXmM DApSUHLyHvp3ZlFZmxyyOzIZU46OXQAhoGxoFwgWrrlrTfhsLJ1yk7Lj7zwDL9UwFjJB 1w6yk6nfpjoqElWiseQ7VNkQI608Flzh0CADDCzWCSf1Pou3oJqd89/o032GiXYHBnwZ f3rb8/UsxcsP1khwVKRh006DBXoCvJBcS+vt5iG9rkPfqRhIdirMYuZdJb8WzEry9yCF e3LXIPxriRRpUIIooDLKg94eIVryP1H0YUtJYWFLmg+8HF8KqWG0lb/dibmGKUlo6WiD jGaA== X-Gm-Message-State: AJaThX6X3vUsPDScNHBRbOXMoUZacp1R5w2i3Ua9idXAT1bhH1oVGI32 H/kLO9jEY/cOhFZaWPF402c= X-Received: by 10.99.114.6 with SMTP id n6mr415247pgc.115.1510806810597; Wed, 15 Nov 2017 20:33:30 -0800 (PST) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id w15sm366576pgc.77.2017.11.15.20.33.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 20:33:30 -0800 (PST) From: Arvind Yadav To: abbotti@mev.co.uk, hsweeten@visionengravers.com, gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH] staging: comedi: ni_atmio: Handle return value of pnp_* Date: Thu, 16 Nov 2017 10:02:32 +0530 Message-Id: <35855327607952b24d97e7f7374a1115f400dd8c.1510806666.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } -- 1.9.1 From 1586583469466696368@xxx Tue Dec 12 13:05:05 +0000 2017 X-GM-THRID: 1586582789684968283 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread