Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4469720pxf; Tue, 16 Mar 2021 14:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfofGmvHkI20W999EOdQhW8wIRDvUOhSuJQypZPtGJeR0MNgatX6SRz+c1tQtCRdXxMtHP X-Received: by 2002:a05:6402:270e:: with SMTP id y14mr38480929edd.283.1615930233329; Tue, 16 Mar 2021 14:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615930233; cv=none; d=google.com; s=arc-20160816; b=ZvyxX0Y0UOo6UhCRKcWcSXuLcmxdVsa146AZxauCA0S+1izLzLHoqxXLUqCllJYk3X /Jyt4ykrFWRw1zYD8AuVa5wJsLdv8mh7919IgLKOO0wmMqvH/0HPsk2ECA1pjxDetQdR SKNEk00RgFg/B/j60ZSkOEjwsNF0jv/mysP3lo0mc4CQdWGQqW1nYA0PHWKDEJJOjniT /8iuB9tdU2ndxrH0a7t16tNtlpNxPakXqMsv0BiSoDBEHPfRy1BIhs0XOMkiRXqCk0Gu 3DsLvgatZjUkEwYjP8L30E7RKGy2JdeFXXt1Y38rU+ql7pRNotIYs1q67TUriKxumVfR xbOA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ADFfDhlBOQDIIEmkqwBqBqB6W+8nwR9CBsVJyMXQsEg=; b=n/46hbwchSCdjjqedtPW7GFXU0KZ9gR/6xvtU51VCpIv5iCyA1/9CaYRWcva+oPzwQ 867wFqX/gNCgr6Pl/ROIsGMaYD0wF6B8TX06hdGj614A4DigFKaM3TfePBFhbbVtbJni gicLW1rcpqQwwH87RvzvhYyWG6EOHlPzoZfybedMqQjLSx5L/onr+vvdK4VpSNKsskQl kAZoWAaQRLFcaRz4LYH9DvQvm3a//OHfWWcGKIOqULLah1fFS4bt8LCJGcdy8Xgb6dYL OuskKLGGUfstzlt/PSf0Jop6KRXp3coEE13DrBDAhh4AyfeBMFe3bWC+88ajU8Vxi5lp yy2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ls+CiT1r; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si14857065eds.403.2021.03.16.14.30.10; Tue, 16 Mar 2021 14:30:33 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=ls+CiT1r; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230511AbhCPVVi (ORCPT + 99 others); Tue, 16 Mar 2021 17:21:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:44438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232433AbhCPVVP (ORCPT ); Tue, 16 Mar 2021 17:21:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 584DB64FA6; Tue, 16 Mar 2021 21:21:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615929674; bh=su/a4cJXKkStHlw0Xv6RaaQR/ej+nELTe/a2v5ZVifY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ls+CiT1rDuu0/020yQNXMyP2EEGdd9tNmW+kVHPmWtJ+PknQ6RpzBiJLaN9fGZlF5 SsBWH/k4HVb5+FzKdDe2t7Ts9xj6H3AD+MvDRZ9U4pgiNYHjkdIeUsRx0zTvSW4vb9 czxtJsbfrwJVmmgL4qHh9R4Ykn9jadnw16nflBaRsNnrkz2sXh9J5hh2VUySY8AlOp oPBF7HIPB7sxJrie0K88Y2byZzXwXNrIuPvm0FIVOX/gbCh1+p6oFdGUmbnCm6q7sB klqBhD8p4rMRS9uoOAiz30GzIEdjKZiD6v/cN2f6NwOS8o6HFxEwWZNHCOQj9J6rX3 tcpWNiprO/D5Q== Date: Tue, 16 Mar 2021 14:21:13 -0700 From: Jakub Kicinski To: Voon Weifeng Cc: "David S . Miller" , Maxime Coquelin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jose Abreu , Giuseppe Cavallaro , Andrew Lunn , Alexandre Torgue , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Ong Boon Leong , Wong Vee Khee Subject: Re: [RESEND v1 net-next 2/5] net: stmmac: make stmmac_interrupt() function more friendly to MSI Message-ID: <20210316142113.40fd721f@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210316121823.18659-3-weifeng.voon@intel.com> References: <20210316121823.18659-1-weifeng.voon@intel.com> <20210316121823.18659-3-weifeng.voon@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Mar 2021 20:18:20 +0800 Voon Weifeng wrote: > + if (unlikely(!dev)) { > + netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__); > + return IRQ_NONE; > + } Where did this check come from? Please avoid defensive programming in the kernel unless you can point out how the condition can arise legitimately.