Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2672324pxb; Mon, 11 Jan 2021 16:45:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfEGEiXLI8LAo9kS9pzDQFbS+j7H0LEm+QobP3OB9Ht/DDWZ2enzmEOQ/rn1ynWB3dJM1e X-Received: by 2002:a17:906:26d7:: with SMTP id u23mr1357280ejc.210.1610412351457; Mon, 11 Jan 2021 16:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610412351; cv=none; d=google.com; s=arc-20160816; b=UcxvtrDYN0WTuv3zDJ1V+LUrE8NP4V7Mz6aWP32TAb61uGZfRygaoDY/JuygHCQTZb +TOTuJSDOCt3nnCA5fafbN4NOOyKPUUONzua662yIJRM2N9Hm+e7oU/tz5yraf/VhryX CZrh3ZiGw4ly1Ti/N5Dc6hQru4PL6sgXPDo+zmcciqNX8e0s07lEsEQQ8Wj5xKe0DQBE bOUiYpfBP699t8/ltYt6Qsutcn2S70osIIpetqslxpQqLAhNv3hUpL7ur+HzB9LtXOjs 5lQod3UX/eYMBaJuZ0GaFCAUHoT9aRLd1M9C6x8cgabS3STWzPXMJ+3mtDrBkNW6MQ48 JkIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UE1z+ySXwheTN4TqRMKElNGCkrGD6X83OqNSLp/WMPU=; b=hC1woOidPsXFku6sZ6Ke/JaJfMCwFYTeO/KA9X0ZyFwsGoS7dihLQWq/Vu4DE8/CmH YAQ3weDGwOswysGCArS0Mgvivx+DrF5MDY/7ouHQGDhfW9l8+VFKoAh2Hi3FoJKwKgu9 su6e6gMJR8lJQJYEuyzaY3KN1GHytSxts/OSTokNUHCNAo3X8tbYyUFa2dkR/BET0Wen omGmD8DJRJIofCLyqAc3y00vQJKCoKOnYPVKWwz3tUD2nPVBz5WI2ehgv69ccm5HYdjI DkKeIkVyHzZOpYJzvHXeB+8W8hOh1aTpiSOdZfzeHIwqGFZFbpMYC4Fs1jkwtPo/u4IE w9ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=obbF5WbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c22si600048edj.34.2021.01.11.16.45.28; Mon, 11 Jan 2021 16:45:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=obbF5WbI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729354AbhAKNCd (ORCPT + 99 others); Mon, 11 Jan 2021 08:02:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:49712 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729314AbhAKNCc (ORCPT ); Mon, 11 Jan 2021 08:02:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EB3B52250E; Mon, 11 Jan 2021 13:01:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370112; bh=mQrKzEhE0lfko0hSa7iYajsD9DroLaanyDC1YYELfsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=obbF5WbI3uXgOUU8YuA2ASLDjwOyAZ/TXGB4O9VD2MB+ObM9//FZ31IDvuOyKmWE6 +Ukya7lz2iU2qlBOy9W1AMBv0N3HKrl3p5DK01LWiai8efIkylGJl9MH3/lRo0RYU0 CqANiUsS9b5AMX/iT3/EI8BewEk2+pDH5Fp9SQKc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunjian Wang , "David S. Miller" Subject: [PATCH 4.4 08/38] net: hns: fix return value check in __lb_other_process() Date: Mon, 11 Jan 2021 14:00:40 +0100 Message-Id: <20210111130032.867246503@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130032.469630231@linuxfoundation.org> References: <20210111130032.469630231@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunjian Wang [ Upstream commit 5ede3ada3da7f050519112b81badc058190b9f9f ] The function skb_copy() could return NULL, the return value need to be checked. Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support") Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -433,6 +433,10 @@ static void __lb_other_process(struct hn /* for mutl buffer*/ new_skb = skb_copy(skb, GFP_ATOMIC); dev_kfree_skb_any(skb); + if (!new_skb) { + netdev_err(ndev, "skb alloc failed\n"); + return; + } skb = new_skb; check_ok = 0;