netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] decnet: dn_dev: Remove an unnecessary label.
@ 2020-07-14 14:13 Suraj Upadhyay
  2020-07-14 14:16 ` Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Suraj Upadhyay @ 2020-07-14 14:13 UTC (permalink / raw)
  To: davem, kuba; +Cc: linux-decnet-user, netdev, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

Remove the unnecessary label from dn_dev_ioctl() and make its error
handling simpler to read.

Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
---
 net/decnet/dn_dev.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 65abcf1b3210..64901bb9f314 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -462,7 +462,9 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
 	switch (cmd) {
 	case SIOCGIFADDR:
 		*((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local;
-		goto rarok;
+		if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
+			ret = -EFAULT;
+			break;
 
 	case SIOCSIFADDR:
 		if (!ifa) {
@@ -485,10 +487,6 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
 	rtnl_unlock();
 
 	return ret;
-rarok:
-	if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
-		ret = -EFAULT;
-	goto done;
 }
 
 struct net_device *dn_dev_get_default(void)
-- 
2.17.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] decnet: dn_dev: Remove an unnecessary label.
  2020-07-14 14:13 [PATCH] decnet: dn_dev: Remove an unnecessary label Suraj Upadhyay
@ 2020-07-14 14:16 ` Julia Lawall
  2020-07-14 14:27   ` Suraj Upadhyay
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2020-07-14 14:16 UTC (permalink / raw)
  To: Suraj Upadhyay
  Cc: davem, kuba, linux-decnet-user, netdev, linux-kernel,
	kernel-janitors



On Tue, 14 Jul 2020, Suraj Upadhyay wrote:

> Remove the unnecessary label from dn_dev_ioctl() and make its error
> handling simpler to read.
>
> Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
> ---
>  net/decnet/dn_dev.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
> index 65abcf1b3210..64901bb9f314 100644
> --- a/net/decnet/dn_dev.c
> +++ b/net/decnet/dn_dev.c
> @@ -462,7 +462,9 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
>  	switch (cmd) {
>  	case SIOCGIFADDR:
>  		*((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local;
> -		goto rarok;
> +		if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
> +			ret = -EFAULT;
> +			break;

The indentation on break does not look correct.

julia

>
>  	case SIOCSIFADDR:
>  		if (!ifa) {
> @@ -485,10 +487,6 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
>  	rtnl_unlock();
>
>  	return ret;
> -rarok:
> -	if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
> -		ret = -EFAULT;
> -	goto done;
>  }
>
>  struct net_device *dn_dev_get_default(void)
> --
> 2.17.1
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] decnet: dn_dev: Remove an unnecessary label.
  2020-07-14 14:16 ` Julia Lawall
@ 2020-07-14 14:27   ` Suraj Upadhyay
  0 siblings, 0 replies; 3+ messages in thread
From: Suraj Upadhyay @ 2020-07-14 14:27 UTC (permalink / raw)
  To: Julia Lawall
  Cc: davem, kuba, linux-decnet-user, netdev, linux-kernel,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]

On Tue, Jul 14, 2020 at 04:16:15PM +0200, Julia Lawall wrote:
> 
> 
> On Tue, 14 Jul 2020, Suraj Upadhyay wrote:
> 
> > Remove the unnecessary label from dn_dev_ioctl() and make its error
> > handling simpler to read.
> >
> > Signed-off-by: Suraj Upadhyay <usuraj35@gmail.com>
> > ---
> >  net/decnet/dn_dev.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
> > index 65abcf1b3210..64901bb9f314 100644
> > --- a/net/decnet/dn_dev.c
> > +++ b/net/decnet/dn_dev.c
> > @@ -462,7 +462,9 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
> >  	switch (cmd) {
> >  	case SIOCGIFADDR:
> >  		*((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local;
> > -		goto rarok;
> > +		if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
> > +			ret = -EFAULT;
> > +			break;
> 
> The indentation on break does not look correct.
> 
> julia

Thanks for your response and advise, sent a v2 patch.

Suraj Upadhyay.

> >
> >  	case SIOCSIFADDR:
> >  		if (!ifa) {
> > @@ -485,10 +487,6 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg)
> >  	rtnl_unlock();
> >
> >  	return ret;
> > -rarok:
> > -	if (copy_to_user(arg, ifr, DN_IFREQ_SIZE))
> > -		ret = -EFAULT;
> > -	goto done;
> >  }
> >
> >  struct net_device *dn_dev_get_default(void)
> > --
> > 2.17.1
> >
> >

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-14 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-14 14:13 [PATCH] decnet: dn_dev: Remove an unnecessary label Suraj Upadhyay
2020-07-14 14:16 ` Julia Lawall
2020-07-14 14:27   ` Suraj Upadhyay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).