From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7F54C43381 for ; Mon, 25 Feb 2019 18:32:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BD6320645 for ; Mon, 25 Feb 2019 18:32:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="vDMfNRf+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728835AbfBYSc5 (ORCPT ); Mon, 25 Feb 2019 13:32:57 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36719 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfBYSc5 (ORCPT ); Mon, 25 Feb 2019 13:32:57 -0500 Received: by mail-qt1-f195.google.com with SMTP id p25so11749321qtb.3 for ; Mon, 25 Feb 2019 10:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=mG5f1HOeJrl7BvcL7cQHtQB6Klaaj3FutHRW80y9PM8=; b=vDMfNRf+3BwZb2buBLeDc7tKaTsoDGj1iRCpol4OqBfIsjswVrMqOaw1Npqxz2YwYi K67q+6m4gDyGPOPMzVM6E6ZtrL5ISunsIOiM78ld164zQjRM/q0ds25O2G5uFDfXHtt7 cNXGsauVMkuqVvnBI4pY9WgSusjn9tkN7ArAzbfkeAGPSSwrX91jYT8PjSDVZCkLXBmi 5F0t3txTqYG6twzPaSaaFInoi8edEoSnmj5k2hV9AZ9joIOl0P0RHY7sT9SUE7IABd9I UVpBQRDnt4fl5PJEWlpZz223uvSeNUEYfgrqYIt/Yw2JIc3OTPTLbMzrC84K+y+hvWM9 o4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=mG5f1HOeJrl7BvcL7cQHtQB6Klaaj3FutHRW80y9PM8=; b=PDAZAeaXzF+etcnzwCBDBn/MPh/KdG0YVM/3AJVh/defIT0cD46rq3n5/rDySM4L5/ v82xaBp+DGAnhnRyvv75WU3xGps5l3dL7qICHMUMkv3w8umRyUUt95Gu257NTmwoc0jH IoAN/UPkvDSW8I7DYtUhI6yqUlplY9SflhfYI1B192wFpQxMu7sw3yjRG2QzaU2XB6lT UngkR7GELEkmcIyOIvpoK3ehLDJXcu1cjegVWZEW+wuGcKX+jkMXa1CH+8hqoo3Ir0Y3 RQV35eAvA1W8zMYaUm2jzvul3sSTMO2owMrJI+85mR9jHqTUBrKWKjBk8bwGdr7Zl3Pv nTmg== X-Gm-Message-State: AHQUAuZtsYyzKIArn3Bml2T//b4CoEMaxI6+13IeH7Bi1hUKBAnOPbgD d6/5xEx1/F+xbtq5Iin95o9Icw== X-Google-Smtp-Source: AHgI3Ias/czd30Q2w6T4xH64alDvD/uhRtGg2UJYP+FHltqzRNaU1qU8JWMzW0h8VOneOCJzhPKcRA== X-Received: by 2002:ac8:366e:: with SMTP id n43mr15213775qtb.162.1551119576237; Mon, 25 Feb 2019 10:32:56 -0800 (PST) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id o21sm6650662qto.18.2019.02.25.10.32.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 10:32:56 -0800 (PST) Date: Mon, 25 Feb 2019 10:32:49 -0800 From: Jakub Kicinski To: Jiri Pirko Cc: davem@davemloft.net, mkubecek@suse.cz, andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH net-next v3 6/6] devlink: add missing NULL checks for devlink ops Message-ID: <20190225103249.15d26b32@cakuba.netronome.com> In-Reply-To: <20190224110319.GJ2759@nanopsycho.orion> References: <20190222220758.7117-1-jakub.kicinski@netronome.com> <20190222220758.7117-7-jakub.kicinski@netronome.com> <20190224110319.GJ2759@nanopsycho.orion> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, 24 Feb 2019 12:03:19 +0100, Jiri Pirko wrote: > Fri, Feb 22, 2019 at 11:07:57PM CET, jakub.kicinski@netronome.com wrote: >> Commit 76726ccb7f46 ("devlink: add flash update command") and >> commit 2d8dc5bbf4e7 ("devlink: Add support for reload") >> access devlink ops without NULL-checking. Add the missing checks. >> Note that all drivers currently implementing devlink pass non-NULL >> ops, so this is not a problem. > > Wouldn't it be better to rather put WARN_ON&fail when driver calls > devlink_alloc() with NULL ops and avoid these checks in the whole code? Sounds good! Should I remove the existing ones?