Re: [PATCH net-next] net: dsa: Add error path handling in dsa_tree_setup()

2019-05-29 Thread Ioana Ciornei
On 5/30/19 2:17 AM, Andrew Lunn wrote: >> @@ -423,18 +434,41 @@ static int dsa_tree_setup_switches(struct >> dsa_switch_tree *dst) >> >> err = dsa_switch_setup(ds); >> if (err) >> -return err; >> +goto setup_switch_err; > > Mino

Re: [PATCH net-next] net: dsa: Add error path handling in dsa_tree_setup()

2019-05-29 Thread Andrew Lunn
> @@ -423,18 +434,41 @@ static int dsa_tree_setup_switches(struct > dsa_switch_tree *dst) > > err = dsa_switch_setup(ds); > if (err) > - return err; > + goto setup_switch_err; Minor nit pick. All the other labels you add are e

[PATCH net-next] net: dsa: Add error path handling in dsa_tree_setup()

2019-05-29 Thread Ioana Ciornei
In case a call to dsa_tree_setup() fails, an attempt to cleanup is made by calling dsa_tree_remove_switch(), which should take care of removing/unregistering any resources previously allocated. This does not happen because it is conditioned by dst->setup being true, which is set only after _all_ se