Subject: Re: [PATCH net-next 2/6] net: make dev_alloc_name() call dev_prep_valid_name()

From: Jakub Kicinski <[email-masked]>
Date: Fri, 20 Oct 2023 12:01:49 -0700

On Fri, 20 Oct 2023 12:24:57 +0200 Jiri Pirko wrote:
> > static int dev_get_valid_name(struct net *net, struct net_device *dev,
> > 			      const char *name)
> > {
> >-	return dev_prep_valid_name(net, dev, name, dev->name);
> >+	int ret;
> >+
> >+	ret = dev_prep_valid_name(net, dev, name, dev->name, EEXIST);
> >+	return ret < 0 ? ret : 0;  
> 
> Why can't you just return dev_prep_valid_name() ?
> 
> No caller seems to care about ret > 0

AFACT dev_change_name() has some weird code that ends up return 
the value all the way to the ioctl and user space. Note that it
has both err and ret variables :S