Subject: Re: error handling for dev_mc_sync (__dev_addr_add)

From: Patrick McHardy <[email-masked]>
Date: Tue, 09 Jun 2009 19:10:55 +0200

Johannes Berg wrote:
> On Tue, 2009-06-09 at 17:00 +0200, Patrick McHardy wrote:
> 
>>> Regular drivers should need to be changed,
>>> would they, except for adding changing 'return' to 'return 0;' and
>>> adding a 'return 0;' at the end which is a quite simple spatch I'd
>>> think.
>> Right.
> 
> Yeah, so this spatch should be sufficient:
> 
> ----- >% -----
> @ ndomatch @
> identifier ndo, sml;
> @@
> struct net_device_ops ndo = {
> .ndo_set_multicast_list = sml,
> };
> @forall@
> identifier dev;
> identifier ndomatch.sml;
> @@
> void sml(struct net_device *dev)

- void
+ int

> {
> ...
> -return;
> +return 0;
> ...
> }
> ----- %< -----
> 
> Haven't really tested it though but it seems to do the correct thing for
> all drivers I looked at.

In case this also adds a return statement at the end if none is
there already, it looks fine.