Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2274249pxb; Mon, 11 Jan 2021 05:47:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwvIC7q0YPo7rSLybSyKveAPB7WQufleXC1SpHtVKlM4U+cwzjWLUIbwf6+UIQcepj6lEjh X-Received: by 2002:a05:6402:1d13:: with SMTP id dg19mr13982254edb.111.1610372851166; Mon, 11 Jan 2021 05:47:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610372851; cv=none; d=google.com; s=arc-20160816; b=FKefXixpnUwyU0Aa6CCwBfnN8gjLYuCwK9AnqiFKNcKOhguTGUoKektRlYQ0Vx1qu4 zw86nyFzbYe5+7qcD27a7RJBBIWx/ExVbHMnQwSTOO77djN8mag6Ogl9Xkm8nbHz84ao taiVX7Aq40s7PNKK6H0Y4WqgxnZ8rFxoY/V57i9tUUCS4U84AaLZvKHIpLPvK9JR8gY6 ZEleumwqOXGES7e/wTSH+cslPP60SReaFGTERUeP9opdPwxBn8M81oQqmSL+x1ttrq5L 7JfbD+DXw9JoX/rBoNurw8zDRVAXgujKU4eKQUfbVLr7zjVFZoe++gnI1bwCtm+6WtxX VoWA== 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=hb9bzr9s6F6663TbdYuJKrRCR9kgYj07ljHhR3E0BMU=; b=IDewAjYKO3bPbKGgq6oNge35erczRTM8krHMuglGDAOsLuNeA1eDbUSw38O5HQkdQV k0Bm5GeI56Pgw+cOtmz2UvgjMGGuF56f/YKtSZqRB80XErFAFCAQJtchas/4SrxWMEJG VSf3+GzD5+Abfhhx4tEJT2MHOxrrqFGswD0ynvyPd62i/dQkIf9bCIW4Lv7emW46HhvQ ZGhn0YOCtFBeDkPABm6gw7IO/9bQEStSS5CUkugYZbHSs118WRRdi+ALBtHWDLpWJeuX /UyeXczYIuwHqC6/CBLVuUF/8inLWZnwakaqLgWPsZLc03u7D3PMdnGDv6NnhTWMfhYQ lBjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K5mjjVjV; 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 d19si5104537edv.401.2021.01.11.05.47.07; Mon, 11 Jan 2021 05:47:31 -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=K5mjjVjV; 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 S2387451AbhAKNmm (ORCPT + 99 others); Mon, 11 Jan 2021 08:42:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:59012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730878AbhAKNMI (ORCPT ); Mon, 11 Jan 2021 08:12:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B967D229CA; Mon, 11 Jan 2021 13:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370713; bh=YRUgOafeQmpHV/J0qrndzUdfreBjoaD9/Lyb/gJf8uM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K5mjjVjVwKljsq9cQnSdpiVugOGW9z+ADWvKav/6DNbQMBActj6w6WLJujllz2WyP 94Ofb8QnIl8j/APz7a9zKFVA9hloqY9wLerjnPzdZVkIvdnY6Sqldm2NyuN7pIIn2L YooiHhPBFaoSAkYxhSRbT3DKhc08ej13dnb6SeGo= 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 5.4 35/92] net: hns: fix return value check in __lb_other_process() Date: Mon, 11 Jan 2021 14:01:39 +0100 Message-Id: <20210111130040.841793263@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@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 @@ -415,6 +415,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;