From patchwork Fri Sep 22 22:13:59 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: 9967199 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 AE9D16057C for ; Fri, 22 Sep 2017 22:15:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FBED28F34 for ; Fri, 22 Sep 2017 22:15:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 941C728F65; Fri, 22 Sep 2017 22:15:27 +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=ham 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 1C04E29631 for ; Fri, 22 Sep 2017 22:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752591AbdIVWOr (ORCPT ); Fri, 22 Sep 2017 18:14:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:23594 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbdIVWOp (ORCPT ); Fri, 22 Sep 2017 18:14:45 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 15:14:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="131500632" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 22 Sep 2017 15:14:22 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dvWI4-000G3E-4F; Sat, 23 Sep 2017 06:19:20 +0800 Date: Sat, 23 Sep 2017 06:13:59 +0800 From: kbuild test robot To: Brijesh Singh Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Brijesh Singh , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Joerg Roedel , Borislav Petkov , Tom Lendacky , x86@kernel.org Subject: [PATCH] KVM: SVM: fix eno.cocci warnings Message-ID: <20170922221359.GA6397@lkp-wsm-ep2> References: <201709230631.6XbWla3b%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170919204627.3875-17-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: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arch/x86/kvm/svm.c:5728:5-11: ERROR: allocation function on line 5727 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: 16e737dd7c3c ("KVM: SVM: Add support for SEV LAUNCH_START command") CC: Brijesh Singh Signed-off-by: Fengguang Wu --- svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -5725,7 +5725,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))