Received: by 10.213.65.68 with SMTP id h4csp38615imn; Mon, 19 Mar 2018 18:48:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELuB8izYdTxfG8NeK0TIExwGOrpSp1heARLd1BKmTeM4f+hixuLLGPevgtDHjYqPlEgHIzwD X-Received: by 10.167.129.67 with SMTP id d3mr12062416pfn.108.1521510508672; Mon, 19 Mar 2018 18:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510508; cv=none; d=google.com; s=arc-20160816; b=GwzaISNDy3rJGlKMw98zrlmRdkZxlHQLrf1Wya0vBiipacjATcRynscdD8s0dW1tTS D2BCnBv84DckE0zRkMCW+rmOej8RMr4hMbevhxT75gpR7hCRQVrPuwk9s3VzMXaTcIR+ oCmEiAJbvmjdlYW7a//gHokzVvZ4iRDt2PlaIpcLjc0vEcBYc0Dz3TBDpbno05YnsIL6 uBhmgrI15ihPc1QyLDhaQkbnL70Bon/JXPRnPY05PtRNV4k7zrHmsT544GUHpaWJ7Q0k OkzAg8xIlnPG7IPxoNSnAZ9jBHon4mhYfcC0E0Oswm0x09TCNGaUoz8+x37ReSh8SE6m I0eg== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9SGTOoLRnSIPJwmfXaWJ7CW0L1xZjm54AwdGTPOBDIo=; b=IcKLWldRyTn198xD+EcLqk5DzQaohKhpsjmXJ28aEwfgBZEzKq+rlvIZmtZnZC/sg3 N5VnJPfDxf2C7u5CeffREgWDhKCE6NIvre9xdbmRXtsgEuLbA/RR4ClTtrcwiqD2ye7V 8vl3RpREAF1Aa3cEiA6ZC67xrIW5iwEnW5mKLMReAt+Pdxwm74ogoDkgzmoNzhJx+q/1 b+0vB0+B5vs7FeReQq2EXFwHtzBbyh13UHpu2p581MjxgcpKKmPvbuhkN5JoUg//o0UM yZHa4I246l5J9TYq2dIDZQhiOJ898ILgtopj0Z8104a5o1WHZZhrHsKnuhFOaK4K/i7f a3lQ== 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 y10-v6si598738plt.533.2018.03.19.18.48.15; Mon, 19 Mar 2018 18:48:28 -0700 (PDT) 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 S971054AbeCST5I (ORCPT + 99 others); Mon, 19 Mar 2018 15:57:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46758 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030852AbeCSSS5 (ORCPT ); Mon, 19 Mar 2018 14:18:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 08E7510D0; Mon, 19 Mar 2018 18:18:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Sasha Levin Subject: [PATCH 4.9 005/241] staging: wilc1000: add check for kmalloc allocation failure. Date: Mon, 19 Mar 2018 19:04:30 +0100 Message-Id: <20180319180751.404292822@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King [ Upstream commit 6cc0c259d034c6ab48f4e12f505213988e73d380 ] Add a sanity check that wid.val has been allocated, fixes a null pointer deference on stamac when calling ether_add_copy. Detected by CoverityScan, CID#1369537 ("Dereference null return value") Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wilc1000/host_interface.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1930,6 +1930,8 @@ static s32 Handle_Get_InActiveTime(struc wid.type = WID_STR; wid.size = ETH_ALEN; wid.val = kmalloc(wid.size, GFP_KERNEL); + if (!wid.val) + return -ENOMEM; stamac = wid.val; memcpy(stamac, strHostIfStaInactiveT->mac, ETH_ALEN);