Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2213659ybl; Thu, 19 Dec 2019 09:49:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxdmCYeO0D4VOBdYrdEefWL2XK2xNrDjDbGfe0cU4EQf4zUaBOcZSr4/JgQ+nufyLLK3mWO X-Received: by 2002:a05:6830:121a:: with SMTP id r26mr3142277otp.225.1576777743823; Thu, 19 Dec 2019 09:49:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576777743; cv=none; d=google.com; s=arc-20160816; b=lgA76MiIYLAE4LoRzssOAGA2XFQ66i7flNbU7uruHUDzHCa6WpjMEpnVDQ/VcYDWYq X/NkHPzRXtHZZa81W+0aK18f6eQcEXvvYixz3qqDbgAgrWSWs0FlkFAHxiJB1kY7+PpK jr9pfHMObBMvooQY4c+9wXI92D1H+cKF5OSqHi3BIyKPER5vF2x0f62jCUJigDAsrEDr eN8Dvqh9Wqx2clVwVxi66xbGWUZKK5SGPiQ17i1sVEw2W9/Z+0g/3hCCkiDYMAPvdShY ZB7haUPh83AovPVrlHxrICueVs3hOGNaL3+RbkkGaf6F1Gyp1I4oDLIIOCwwWHqI95cJ mQAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=yUkwuJ/53tcNbXGC0lwr65F4D6FXGy09FfVgEZ0jVZ8=; b=srb7IyrgnphSpI9T0HYFtJdUzEO2hHh5WcuPHy9awmLQQqDmkfOE9kFH8R2RnoSUPO FSp4DMXCtkaVS4YsbMxCV5XVOHDP5xs8aEkpCXmdoZhvqZuyJEXvuv2UrWxuCblz/E/k 5OBOV7aI7qHVpbOOXdtOnEJlp2JU6JHj70/phYEpaGvIRYm955aEiVN/4kX+a7a9LVmh diHwzm2fPu7G9dudMuLAM/49KxQlY0MWOTdDOQdH4tNCZOISTY2YGIm0w+u079OQ378p n7DlioQEbf5LU4qwWo7MP0Knwj6zh5ERGdCJc4Uou1tcFZkh0xGLTHq/qX4NbvCU7Tld 9V5g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si3341698oic.126.2019.12.19.09.48.51; Thu, 19 Dec 2019 09:49:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726948AbfLSRsK (ORCPT + 99 others); Thu, 19 Dec 2019 12:48:10 -0500 Received: from mout02.posteo.de ([185.67.36.142]:46773 "EHLO mout02.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726855AbfLSRsK (ORCPT ); Thu, 19 Dec 2019 12:48:10 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id DFECF240101 for ; Thu, 19 Dec 2019 18:40:47 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47dzgL4SfTz9rxM; Thu, 19 Dec 2019 18:40:46 +0100 (CET) Date: Thu, 19 Dec 2019 18:40:45 +0100 (CET) From: Marc Dietrich X-X-Sender: lucile@macbook-pro.fritz.box To: Xidong Wang cc: Marc Dietrich , Greg Kroah-Hartman , ac100@lists.launchpad.net, linux-tegra@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] staging: nvec: check return value In-Reply-To: <1576648598-12257-1-git-send-email-wangxidong_97@163.com> Message-ID: References: <1576648598-12257-1-git-send-email-wangxidong_97@163.com> User-Agent: Alpine 2.21 (OSX 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Xidong, On Wed, 18 Dec 2019, Xidong Wang wrote: > In nvec_kbd_probe(), the return value of devm_input_allocate_device() > should be checked before it is used. > > Signed-off-by: Xidong Wang looks good to me. Thanks! Acked-by: Marc Dietrich > --- > drivers/staging/nvec/nvec_kbd.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c > index 01dbb66..386d619 100644 > --- a/drivers/staging/nvec/nvec_kbd.c > +++ b/drivers/staging/nvec/nvec_kbd.c > @@ -123,6 +123,8 @@ static int nvec_kbd_probe(struct platform_device *pdev) > keycodes[j++] = extcode_tab_us102[i]; > > idev = devm_input_allocate_device(&pdev->dev); > + if (!idev) > + return -ENOMEM; > idev->name = "nvec keyboard"; > idev->phys = "nvec"; > idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_LED); > -- > 2.7.4 > >