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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 5E626C32771 for ; Mon, 27 Jan 2020 06:25:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A1F5214AF for ; Mon, 27 Jan 2020 06:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727307AbgA0GY7 (ORCPT ); Mon, 27 Jan 2020 01:24:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:48196 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbgA0GY7 (ORCPT ); Mon, 27 Jan 2020 01:24:59 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 608F3AE09; Mon, 27 Jan 2020 06:24:57 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id A1530E0B78; Mon, 27 Jan 2020 07:24:56 +0100 (CET) Date: Mon, 27 Jan 2020 07:24:56 +0100 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Andrew Lunn , David Miller , Jakub Kicinski , Jiri Pirko , Florian Fainelli , John Linville , Johannes Berg , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 3/7] ethtool: set message mask with DEBUG_SET request Message-ID: <20200127062456.GC570@unicorn.suse.cz> References: <844bf6bf518640fbfc67b5dd7976d9e8683c2d2d.1580075977.git.mkubecek@suse.cz> <20200127010422.GD12816@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127010422.GD12816@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 02:04:22AM +0100, Andrew Lunn wrote: > > + ret = ethnl_parse_header(&req_info, tb[ETHTOOL_A_DEBUG_HEADER], > > + genl_info_net(info), info->extack, true); > > > + dev_put(dev); > > Hi Michal > > While reviewing this patch i noticed this dev_put() and wondered where > the dev_get() was. It is hiding inside ethnl_parse_header(). The > documentation does make it clear it takes a reference on the device, > but how many people read the documentation? I would not be too > surprised if at some point in the future we have bugs from missing > dev_put(). > > Could we make this a bit more explicit by calling it > ethnl_parse_header_dev_get(). It is rather long though. Good point, I'll think about the name some more and send a cleanup patch when net-next reopens. Michal