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=-2.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 9F964C43381 for ; Tue, 26 Feb 2019 07:00:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E9A92173C for ; Tue, 26 Feb 2019 07:00:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="QqIORMBv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726547AbfBZHAr (ORCPT ); Tue, 26 Feb 2019 02:00:47 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36725 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfBZHAr (ORCPT ); Tue, 26 Feb 2019 02:00:47 -0500 Received: by mail-wr1-f67.google.com with SMTP id o17so12630240wrw.3 for ; Mon, 25 Feb 2019 23:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qy6JHdOtvDU3gQ9Y2PSpbV/NBMr92zZ/jWMLbEsno+c=; b=QqIORMBvk/2Yaq/y7qbsDiUUC+Xn1rNnR+WbxgAoVx3ZiC+7r4nRRpT176C8MHFglh iqq5I6ktRgHl7RUJGoCoqv2oFJl6DCW+ATZcx+2P85ZCeoer2baqD1QeaYPWThUbQN+8 38Aj05+DgZ3At9+vZ/Y0/0L5lTMeyYscmDT4iD32XXLFrkrEZXzRQYKAKFvvdorBc+f7 /rr7FPN1VC/fRjtqaafdwCJ1ahlHhBsuI9qynpFVtYeSxhS7xR5kRwet12eBIVDYHK87 cYC2llRpt3pQ0ECUfYzGKeaHk6qsRKBWofdFsZPIw9plaOr/F2Cq/E0YdLPEpog/Ms0M yyrQ== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qy6JHdOtvDU3gQ9Y2PSpbV/NBMr92zZ/jWMLbEsno+c=; b=hA78fORH3ONEYf6m78exAB/TtZth9sQR4phSIPWVnlYL6QwvSb/rSEa2PJdZqI6Wfs ehJnH+vQTFYiaJYbw2JB7wbyNMcN+xwIuK4QSY7SlTeTVHrqH+Jz6t02vUFGYGZo26IX jeRBgYXy1q46axgaBVBlbfhCWbqil/3UmGJivEQqv13dZed+Co75CbmgG9+6OS/cRO78 bKyPXIvEUkRVrVHj0ViIOr++Lr10hwyXWL3LD8SCXFHc6wbVyl/iSXSKk1bf6fSclM3m 72YdqilD3IWK6iiOJij/uC00sDpAQ22zlt6re0QxVnzL6hAZXKA0+IWBQj/absisHzYb S/kQ== X-Gm-Message-State: AHQUAubMnyWHp7n/lVD59tkMy+Qx7OM+VVRn4nKgsOWZPx7/uBwowYzZ wmQlfBdld89Z1SdL2yCnd9YayA== X-Google-Smtp-Source: AHgI3IZCk2oac6q7RD1lnGdo44KLN2Vy1CwY0tw+2cw6+BQAffG3EqOj1MFYGaVcUG2eI7N18oMXSA== X-Received: by 2002:adf:f244:: with SMTP id b4mr16105881wrp.289.1551164445097; Mon, 25 Feb 2019 23:00:45 -0800 (PST) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id p16sm25814762wro.25.2019.02.25.23.00.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Feb 2019 23:00:44 -0800 (PST) Date: Tue, 26 Feb 2019 07:50:54 +0100 From: Jiri Pirko To: Jakub Kicinski 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: <20190226065054.GB2338@nanopsycho.orion> References: <20190222220758.7117-1-jakub.kicinski@netronome.com> <20190222220758.7117-7-jakub.kicinski@netronome.com> <20190224110319.GJ2759@nanopsycho.orion> <20190225103249.15d26b32@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190225103249.15d26b32@cakuba.netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Mon, Feb 25, 2019 at 07:32:49PM CET, jakub.kicinski@netronome.com wrote: >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? Yes please.