Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932444AbdDFXPj (ORCPT ); Thu, 6 Apr 2017 19:15:39 -0400 Received: from mail-io0-f176.google.com ([209.85.223.176]:34401 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752835AbdDFXPb (ORCPT ); Thu, 6 Apr 2017 19:15:31 -0400 Date: Thu, 6 Apr 2017 16:15:27 -0700 From: Jakub Kicinski To: Colin King Cc: "David S . Miller" , Simon Horman , oss-drivers@netronome.com, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][-next] nfp: don't dereference a null nn->eth_port to print a warning Message-ID: <20170406161527.55b1fd07@cakuba> In-Reply-To: <20170406125435.18898-1-colin.king@canonical.com> References: <20170406125435.18898-1-colin.king@canonical.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 589 Lines: 16 On Thu, 6 Apr 2017 13:54:35 +0100, Colin King wrote: > From: Colin Ian King > > On the case where nn->eth_port is null the warning message > is printing the port by dereferencing this null pointer. > Remove the deference to avoid a crash when printing the > warning message. > > Detected by CoverityScan, CID#1426198 ("Dereference after null check") > > Fixes: ce22f5a2cbe3c627 ("nfp: separate high level and low level NSP headers") > Signed-off-by: Colin Ian King Acked-by: Jakub Kicinski Thanks!