linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: pi433: fix missing break in switch statement.
@ 2017-11-09 17:19 Colin King
  2017-11-09 18:34 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Colin King @ 2017-11-09 17:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Marcus Wolf, Al Viro, devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
to the default case and errorenously return -EINVAL. Fix this by
adding in missing break.

Detected by CoverityScan, CID#1461286 ("Missing break in switch")

Fixes: f81f0b5c9a30 ("pi433: sanitize ioctl")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/pi433/pi433_if.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 3bcb59811cdf..a960fe2e7875 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -811,6 +811,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		}
 
 		mutex_unlock(&device->rx_lock);
+		break;
 	default:
 		retval = -EINVAL;
 	}
-- 
2.14.1

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

* Re: [PATCH] staging: pi433: fix missing break in switch statement.
  2017-11-09 17:19 [PATCH] staging: pi433: fix missing break in switch statement Colin King
@ 2017-11-09 18:34 ` Al Viro
  2017-11-09 21:48 ` Dan Carpenter
  2017-11-10 16:49 ` Marcus Wolf
  2 siblings, 0 replies; 6+ messages in thread
From: Al Viro @ 2017-11-09 18:34 UTC (permalink / raw)
  To: Colin King
  Cc: Greg Kroah-Hartman, Marcus Wolf, devel, kernel-janitors, linux-kernel

On Thu, Nov 09, 2017 at 05:19:55PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
> to the default case and errorenously return -EINVAL. Fix this by
> adding in missing break.

Folded and pushed...

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

* Re: [PATCH] staging: pi433: fix missing break in switch statement.
  2017-11-09 17:19 [PATCH] staging: pi433: fix missing break in switch statement Colin King
  2017-11-09 18:34 ` Al Viro
@ 2017-11-09 21:48 ` Dan Carpenter
  2017-11-10 16:49 ` Marcus Wolf
  2 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2017-11-09 21:48 UTC (permalink / raw)
  To: Colin King
  Cc: Greg Kroah-Hartman, Marcus Wolf, Al Viro, devel, kernel-janitors,
	linux-kernel

On Thu, Nov 09, 2017 at 05:19:55PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
> to the default case and errorenously return -EINVAL. Fix this by
> adding in missing break.
> 

Could you fix PI433_IOC_RD_RX_CFG as well?  There is a missing return
statement if the copy_to_user() fails we fall through to here and error
out.

regards,
dan carpenter

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

* Re: [PATCH] staging: pi433: fix missing break in switch statement.
  2017-11-09 17:19 [PATCH] staging: pi433: fix missing break in switch statement Colin King
  2017-11-09 18:34 ` Al Viro
  2017-11-09 21:48 ` Dan Carpenter
@ 2017-11-10 16:49 ` Marcus Wolf
  2017-11-10 17:04   ` Colin Ian King
  2 siblings, 1 reply; 6+ messages in thread
From: Marcus Wolf @ 2017-11-10 16:49 UTC (permalink / raw)
  To: Colin King, Greg Kroah-Hartman, Marcus Wolf, Al Viro, devel
  Cc: kernel-janitors, linux-kernel

Hi all!

Tryed to cross check...

Don't get it, sorry.

On my private version control (my SVN), where I initially developed the 
driver the break isn't missing.
Same with my git copy of Gregs staging tree. Break is there...

Who removed it, why is it missing in Colins copy?

Am I working on a wrong version?

marcus@Laptop-Wolf:~/staging/drivers/staging/pi433$ git remote show origin
* remote origin
   Fetch URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
   Push  URL: 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git


Can anybody help me?

Thanks,

Marcus


Am 09.11.2017 um 19:19 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
> to the default case and errorenously return -EINVAL. Fix this by
> adding in missing break.
> 
> Detected by CoverityScan, CID#1461286 ("Missing break in switch")
> 
> Fixes: f81f0b5c9a30 ("pi433: sanitize ioctl")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/staging/pi433/pi433_if.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
> index 3bcb59811cdf..a960fe2e7875 100644
> --- a/drivers/staging/pi433/pi433_if.c
> +++ b/drivers/staging/pi433/pi433_if.c
> @@ -811,6 +811,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>   		}
>   
>   		mutex_unlock(&device->rx_lock);
> +		break;
>   	default:
>   		retval = -EINVAL;
>   	}
> 

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

* Re: [PATCH] staging: pi433: fix missing break in switch statement.
  2017-11-10 16:49 ` Marcus Wolf
@ 2017-11-10 17:04   ` Colin Ian King
  2017-11-10 17:14     ` Marcus Wolf
  0 siblings, 1 reply; 6+ messages in thread
From: Colin Ian King @ 2017-11-10 17:04 UTC (permalink / raw)
  To: Marcus Wolf, Greg Kroah-Hartman, Marcus Wolf, Al Viro, devel
  Cc: kernel-janitors, linux-kernel

On 10/11/17 16:49, Marcus Wolf wrote:
> Hi all!
> 
> Tryed to cross check...
> 
> Don't get it, sorry.
> 
> On my private version control (my SVN), where I initially developed the
> driver the break isn't missing.
> Same with my git copy of Gregs staging tree. Break is there...
> 
> Who removed it, why is it missing in Colins copy?
> 
> Am I working on a wrong version?

I was working on the latest, that got landed into linux-next. This had
picked up some modifications from Al-Viro.

Hope that clarifies things

Colin

> 
> marcus@Laptop-Wolf:~/staging/drivers/staging/pi433$ git remote show origin
> * remote origin
>   Fetch URL:
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>   Push  URL:
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
> 
> 
> Can anybody help me?
> 
> Thanks,
> 
> Marcus
> 
> 
> Am 09.11.2017 um 19:19 schrieb Colin King:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
>> to the default case and errorenously return -EINVAL. Fix this by
>> adding in missing break.
>>
>> Detected by CoverityScan, CID#1461286 ("Missing break in switch")
>>
>> Fixes: f81f0b5c9a30 ("pi433: sanitize ioctl")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/staging/pi433/pi433_if.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/staging/pi433/pi433_if.c
>> b/drivers/staging/pi433/pi433_if.c
>> index 3bcb59811cdf..a960fe2e7875 100644
>> --- a/drivers/staging/pi433/pi433_if.c
>> +++ b/drivers/staging/pi433/pi433_if.c
>> @@ -811,6 +811,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd,
>> unsigned long arg)
>>           }
>>             mutex_unlock(&device->rx_lock);
>> +        break;
>>       default:
>>           retval = -EINVAL;
>>       }
>>
> -- 
> To unsubscribe from this list: send the line "unsubscribe
> kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] staging: pi433: fix missing break in switch statement.
  2017-11-10 17:04   ` Colin Ian King
@ 2017-11-10 17:14     ` Marcus Wolf
  0 siblings, 0 replies; 6+ messages in thread
From: Marcus Wolf @ 2017-11-10 17:14 UTC (permalink / raw)
  To: Colin Ian King, Greg Kroah-Hartman, Marcus Wolf, Al Viro, devel
  Cc: kernel-janitors, linux-kernel

Hi Colin,

thanks for clarification.

Should I switch to that repo for further work, too?

If so, can anybody provide me the link?

Do I need Gregs staging any longer, or is it kind of dead for devel on
pi433 driver?

Thank you so much!

Marcus

Am 10.11.2017 um 18:04 schrieb Colin Ian King:
> On 10/11/17 16:49, Marcus Wolf wrote:
>> Hi all!
>>
>> Tryed to cross check...
>>
>> Don't get it, sorry.
>>
>> On my private version control (my SVN), where I initially developed the
>> driver the break isn't missing.
>> Same with my git copy of Gregs staging tree. Break is there...
>>
>> Who removed it, why is it missing in Colins copy?
>>
>> Am I working on a wrong version?
> 
> I was working on the latest, that got landed into linux-next. This had
> picked up some modifications from Al-Viro.
> 
> Hope that clarifies things
> 
> Colin
> 
>>
>> marcus@Laptop-Wolf:~/staging/drivers/staging/pi433$ git remote show origin
>> * remote origin
>>   Fetch URL:
>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>>   Push  URL:
>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
>>
>>
>> Can anybody help me?
>>
>> Thanks,
>>
>> Marcus
>>
>>
>> Am 09.11.2017 um 19:19 schrieb Colin King:
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> The PI433_IOC_WR_RX_CFG case is missing a break and will fall through
>>> to the default case and errorenously return -EINVAL. Fix this by
>>> adding in missing break.
>>>
>>> Detected by CoverityScan, CID#1461286 ("Missing break in switch")
>>>
>>> Fixes: f81f0b5c9a30 ("pi433: sanitize ioctl")
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>> ---
>>>   drivers/staging/pi433/pi433_if.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/staging/pi433/pi433_if.c
>>> b/drivers/staging/pi433/pi433_if.c
>>> index 3bcb59811cdf..a960fe2e7875 100644
>>> --- a/drivers/staging/pi433/pi433_if.c
>>> +++ b/drivers/staging/pi433/pi433_if.c
>>> @@ -811,6 +811,7 @@ pi433_ioctl(struct file *filp, unsigned int cmd,
>>> unsigned long arg)
>>>           }
>>>             mutex_unlock(&device->rx_lock);
>>> +        break;
>>>       default:
>>>           retval = -EINVAL;
>>>       }
>>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe
>> kernel-janitors" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-11-10 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 17:19 [PATCH] staging: pi433: fix missing break in switch statement Colin King
2017-11-09 18:34 ` Al Viro
2017-11-09 21:48 ` Dan Carpenter
2017-11-10 16:49 ` Marcus Wolf
2017-11-10 17:04   ` Colin Ian King
2017-11-10 17:14     ` Marcus Wolf

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).