Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4178679rwj; Tue, 20 Dec 2022 07:05:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXvsLJHHqTxiOimD9lfI5NwQvMkmq55jSghIWZcHHYeYvxPzXaYeaoeAsDay9e0zUY5U64Ti X-Received: by 2002:a17:906:5012:b0:7c1:2e19:ba3f with SMTP id s18-20020a170906501200b007c12e19ba3fmr2132686ejj.57.1671548743932; Tue, 20 Dec 2022 07:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671548743; cv=none; d=google.com; s=arc-20160816; b=w9MLy+AznDod0r3EUVNrdAMWTDezY/rtUQE4HfvUmFO6gG7EWo2eZoPIZPq/T1pf3H 0p+D+Z3/3jIlSYrxtV/b67WAG8pdDl9MAU1/kfBP5yFgb0Gm5zdrZEIKplh0tlFzvzvM FFDEysjnyF5NZ0TNWr+LuxPJSIFhMk+DZ4I8F5EeChvK8hEkd1yjo946jTQb1jsEXB+E od4qFaGvl2ZjXoHgfRRsvGX+IjjxmvBb2EMmkrww6Wu41O/rZeyiamdQ7Lm24pbSyLu+ Vqec6JLOmUzBuCr/hFvNeQjHSpyWylo/AsZAQ9/Sd07fo2+8Cuk1r9iFRxJueJzE8ane X2Gg== 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:date:cc:to:from:subject :message-id:dkim-signature; bh=0z2BB7HZepudK9U4VAxjDq32wvem0CZa2ZoIWPry1PE=; b=tQkhg80A+Xx4gngB77ISJXueY+jK/c8lQoxtixB0+ELp2JHaj39lzNPFk46c97E6ga mhDo8HbnvuHuCgejgDMd6ceWtMFVt6PuzLLVhwLnYzKdT4M0iRLwkfEvkCrnh+tERbn0 8B67n/rfipvUY93EM9P8hSJkP5TGuxAujHtqgMt8fB0KJELC5cBRvX51L8pIhS3Cvv36 eK+/OzVTBKHB4U8ZxxxLtKLxPY44g/ZQA7vTU5xPBvSGoqbHrFYWAj7OggNSQo/bWTEZ DvlNEJI6TOe00rzAZYeYuk//WzZhbFRR69U6wd7tT8eyurEKAS1ceycTbPvnyNPBGFeK jiHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aWEuZTBV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wz8-20020a170906fe4800b0078e1e216396si12067127ejb.66.2022.12.20.07.05.27; Tue, 20 Dec 2022 07:05:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aWEuZTBV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234135AbiLTOr6 (ORCPT + 69 others); Tue, 20 Dec 2022 09:47:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234116AbiLTOrw (ORCPT ); Tue, 20 Dec 2022 09:47:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2F35F66 for ; Tue, 20 Dec 2022 06:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671547624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0z2BB7HZepudK9U4VAxjDq32wvem0CZa2ZoIWPry1PE=; b=aWEuZTBVF+RY+cJM6qM+cMX2I4bpwjD21Kl3Wlz3HhYtFOSgf/xk+a2JyFRzl23Q7arcrA PPcrskr4qvUCv3MkxH4yL72hb8YreZbz1/nu9R9kdM8R/4pN9KO33moWqKfGBOUoE6f3bM ueke70TgPcsZ2gQKWp1ifLrYFWoTeOE= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-622-UjWTUs5tN9WretwQ8GEh7w-1; Tue, 20 Dec 2022 09:47:01 -0500 X-MC-Unique: UjWTUs5tN9WretwQ8GEh7w-1 Received: by mail-qv1-f72.google.com with SMTP id q17-20020a056214019100b004b1d3c9f3acso7218248qvr.0 for ; Tue, 20 Dec 2022 06:47:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0z2BB7HZepudK9U4VAxjDq32wvem0CZa2ZoIWPry1PE=; b=tLFrDF1EOASS4qbzKebRGVJys1VTmXh6gp+l0QAZ271K71qS0ZX9ADM/wWzHp0XkQA +GaqbXYsbq2WxhiGpzQdzexJqizdND1dMMf7yD+9lcQjVZPOMK2pjZqg6S5qpuOpGXpU +uivFhasUElQZXQRGH7R2Wh24OJTLV66Pyumav+gHiBie7ktR/JIZUXpMbh63ten9n3N Wo/mB2xePiXNQT970DaGcUPeRT5j7dXxH0GWVqnj1/bIvTef9d69pVRnKD9/MgNDrtaV GFWdCcorgcTUnqI/5O9ouGmyLsPCa4RWa8jAs+IcFrcDxUp+X7usBUE6uppo+/16n/XO Xwbg== X-Gm-Message-State: AFqh2koPKk+UoiCQDo301Kh6JWxKAzj2VZpatzPzZu0ahEyYBieBsP2Q 19Xaw5hE9zYsCmbZiqIoTrpdBkSIv69kp2sjCctYgfEcf1q/oUCAARcLhGUijExhqiDF3Smz+A5 bQOZI+urKjrzSiF/5AzM5xhIQ X-Received: by 2002:a0c:c210:0:b0:4c6:e48c:be32 with SMTP id l16-20020a0cc210000000b004c6e48cbe32mr18364191qvh.17.1671547620909; Tue, 20 Dec 2022 06:47:00 -0800 (PST) X-Received: by 2002:a0c:c210:0:b0:4c6:e48c:be32 with SMTP id l16-20020a0cc210000000b004c6e48cbe32mr18364170qvh.17.1671547620655; Tue, 20 Dec 2022 06:47:00 -0800 (PST) Received: from gerbillo.redhat.com (146-241-101-173.dyn.eolo.it. [146.241.101.173]) by smtp.gmail.com with ESMTPSA id c24-20020a05620a11b800b006fc2cee4486sm8843945qkk.62.2022.12.20.06.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Dec 2022 06:47:00 -0800 (PST) Message-ID: <90ff72e75142e377273ef980ca2d26951449610c.camel@redhat.com> Subject: Re: [PATCH net] net: fec: Coverity issue: Dereference null return value From: Paolo Abeni To: wei.fang@nxp.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, xiaoning.wang@nxp.com, shenwei.wang@nxp.com, linux-imx@nxp.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 20 Dec 2022 15:46:56 +0100 In-Reply-To: <20221215091149.936369-1-wei.fang@nxp.com> References: <20221215091149.936369-1-wei.fang@nxp.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, 2022-12-15 at 17:11 +0800, wei.fang@nxp.com wrote: > From: Wei Fang > > The build_skb might return a null pointer but there is no check on the > return value in the fec_enet_rx_queue(). So a null pointer dereference > might occur. To avoid this, we check the return value of build_skb. If > the return value is a null pointer, the driver will recycle the page and > update the statistic of ndev. Then jump to rx_processing_done to clear > the status flags of the BD so that the hardware can recycle the BD. > > Signed-off-by: Wei Fang > Reviewed-by: Shenwei Wang You need to include a suitable fixes tag here. Please repost adding it and retaining Alex's reviwed-by tag, thanks! Paolo