Received: by 10.213.65.68 with SMTP id h4csp1715469imn; Mon, 19 Mar 2018 11:15:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELsXdFYrkONpyShSGd5cfOFYKVAbikWoZya8OE1fVdh6LEWMeNLX8IF45Yd7/5MKFW+bKyBT X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr13377273ply.242.1521483346413; Mon, 19 Mar 2018 11:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483346; cv=none; d=google.com; s=arc-20160816; b=AAvgMmElWzl8SsIu+O1w0LN97K3uPQIBGmAbHX6f9nQypt/QYODSm2lL1SAidyViiY PU0WRleynTZ+qmsKk9PgEqKO6ljyBOEHjw5MArcpeDnZxOluHnltN6JpjVd/XPUV7m+2 Ordr1rMddAQ/NBfz5b3OoO2J2YkpVphh1n/cewAw/d/wkYdaL/xmQBBdk8qiz+pYxCDT VjhZ3UH+7o7e/Ljz52W2jG415J6UOqOpvlFI7qaFOp7fH3caxM1XKSYc/8VXV/ZH8MVI /Y/YdF8v2HqEn0qegwW6igPsZ5UPAJv+ka9n4cnJqwzb3NpY7dbUEKzQqM8q0/xNeRKZ Pykg== 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=4n7ZkLlMQJMMtq7vibI8oyTKM7ord5wzWEfKbQz4Qes=; b=juaXOoHUKA5iCccm55leGWQ4h35/wilBkexJDuGSpB4XIQKPuHOm1REovvxsEI9WHJ 2bloz2wtKngu+mF4uM+m45UxQEcwcndDzHVbJiaaZX4RpHxL990NR5WV28fL+LYMMQhl 0Csev1mg4xCtHv5OS8HfVUppRTcQFto5ALLzew0FtJozn7puoGeRcQLu63A7KH5ZA0RQ vADbTBBMsCGcob7zh2py8iM0Y1MijxCOUJ5k/YCPkBJCklWLtY3KESU9ylsOLTICkxBS uQFD5TWB4ocJahJrbS5T5BqR+bvcJ+4XiTwbyDZlQLyF6U6LJUeBrrvWhAmyUYPCrPU0 fvRg== 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 y2-v6si381347plh.649.2018.03.19.11.15.32; Mon, 19 Mar 2018 11:15:46 -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 S1030567AbeCSSN0 (ORCPT + 99 others); Mon, 19 Mar 2018 14:13:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43084 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030465AbeCSSNV (ORCPT ); Mon, 19 Mar 2018 14:13:21 -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 E994F1229; Mon, 19 Mar 2018 18:13:20 +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.4 004/134] staging: wilc1000: add check for kmalloc allocation failure. Date: Mon, 19 Mar 2018 19:04:47 +0100 Message-Id: <20180319171849.680994638@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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 @@ -2179,6 +2179,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);