From patchwork Fri Sep 22 21:35:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9967157 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3684860381 for ; Fri, 22 Sep 2017 21:37:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 287B729616 for ; Fri, 22 Sep 2017 21:37:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C723296FC; Fri, 22 Sep 2017 21:37:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F6FC29616 for ; Fri, 22 Sep 2017 21:37:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbdIVVgk (ORCPT ); Fri, 22 Sep 2017 17:36:40 -0400 Received: from mga07.intel.com ([134.134.136.100]:48056 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752179AbdIVVgX (ORCPT ); Fri, 22 Sep 2017 17:36:23 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 22 Sep 2017 14:36:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="154498429" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga005.fm.intel.com with ESMTP; 22 Sep 2017 14:36:21 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dvVhG-000XwZ-95; Sat, 23 Sep 2017 05:41:18 +0800 Date: Sat, 23 Sep 2017 05:35:58 +0800 From: kbuild test robot To: Brijesh Singh Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Brijesh Singh , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Borislav Petkov , Herbert Xu , Gary Hook , Tom Lendacky , linux-crypto@vger.kernel.org Subject: [PATCH] crypto: ccp: fix eno.cocci warnings Message-ID: <20170922213558.GA3023@lkp-wsm-ep2> References: <201709230544.TcZ8OD1t%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170919204627.3875-8-brijesh.singh@amd.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/crypto/ccp/psp-dev.c:311:5-11: ERROR: allocation function on line 310 returns NULL not ERR_PTR on failure The various basic memory allocation functions don't return ERR_PTR Generated by: scripts/coccinelle/null/eno.cocci Fixes: 7d4ce155f344 ("crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support") CC: Brijesh Singh Signed-off-by: Fengguang Wu --- psp-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/crypto/ccp/psp-dev.c +++ b/drivers/crypto/ccp/psp-dev.c @@ -308,7 +308,7 @@ static void *copy_user_blob(u64 __user u return ERR_PTR(-EINVAL); data = kmalloc(len, GFP_KERNEL); - if (IS_ERR(data)) + if (!data) return ERR_PTR(-ENOMEM); if (copy_from_user(data, (void __user *)(uintptr_t)uaddr, len))