lkml.org 
[lkml]   [2020]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next 3/7] ethtool: set message mask with DEBUG_SET request
> +	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.

Andrew

\
 
 \ /
  Last update: 2020-01-27 02:05    [W:0.091 / U:1.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site