Re: [PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread Oliver Hartkopp
On 10/28/2017 10:23 AM, SF Markus Elfring wrote: @@ -227,10 +227,8 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,   netif_carrier_off(peer);     err = rtnl_configure_link(peer, ifmp); -    if (err < 0) { -    unregister_netdevice(peer); -    return err;

Re: [PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread SF Markus Elfring
>> @@ -227,10 +227,8 @@ static int vxcan_newlink(struct net *net, struct >> net_device *dev, >>   netif_carrier_off(peer); >>     err = rtnl_configure_link(peer, ifmp); >> -    if (err < 0) { >> -    unregister_netdevice(peer); >> -    return err; >> -    } >> +    if (err) >> +   

Re: [PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-28 Thread Oliver Hartkopp
Hi Markus, On 10/27/2017 10:30 PM, SF Markus Elfring wrote: From: Markus Elfring Date: Fri, 27 Oct 2017 22:22:24 +0200 * Add a jump target so that a bit of exception handling can be better reused at the end of this function. * Adjust two condition checks.

[PATCH] can: Use common error handling code in vxcan_newlink()

2017-10-27 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 27 Oct 2017 22:22:24 +0200 * Add a jump target so that a bit of exception handling can be better reused at the end of this function. * Adjust two condition checks. This issue was detected by using the Coccinelle software.