linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: fix missing break in switch statement
@ 2018-10-08 20:47 Colin King
  2019-01-29 20:49 ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-10-08 20:47 UTC (permalink / raw)
  To: Ben Skeggs, David Airlie, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel

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

The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls
through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up
re-assigning the getparam->value to an undesired value. Fix this by adding
in the missing break.

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

Fixes: 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
index e67a471331b5..6ec745873bc5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
@@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
 			WARN_ON(1);
 			break;
 		}
+		break;
 	case NOUVEAU_GETPARAM_FB_SIZE:
 		getparam->value = drm->gem.vram_available;
 		break;
-- 
2.17.1


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

* Re: [PATCH] drm/nouveau: fix missing break in switch statement
  2018-10-08 20:47 [PATCH] drm/nouveau: fix missing break in switch statement Colin King
@ 2019-01-29 20:49 ` Gustavo A. R. Silva
  2019-01-29 21:04   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-29 20:49 UTC (permalink / raw)
  To: Colin King, Ben Skeggs, David Airlie, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel



On 10/8/18 3:47 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls
> through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up
> re-assigning the getparam->value to an undesired value. Fix this by adding
> in the missing break.
> 
> Detected by CoverityScan, CID#1460507 ("Missing break in switch")
> 
> Fixes: 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Reviewed-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Friendly ping:

Who can take this?

Thanks
--
Gustavo

> ---
>  drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> index e67a471331b5..6ec745873bc5 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
> @@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
>  			WARN_ON(1);
>  			break;
>  		}
> +		break;
>  	case NOUVEAU_GETPARAM_FB_SIZE:
>  		getparam->value = drm->gem.vram_available;
>  		break;
> 

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

* Re: [PATCH] drm/nouveau: fix missing break in switch statement
  2019-01-29 20:49 ` Gustavo A. R. Silva
@ 2019-01-29 21:04   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-29 21:04 UTC (permalink / raw)
  To: Colin King, Ben Skeggs, David Airlie, dri-devel, nouveau
  Cc: kernel-janitors, linux-kernel



On 1/29/19 2:49 PM, Gustavo A. R. Silva wrote:
> 
> 
> On 10/8/18 3:47 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The NOUVEAU_GETPARAM_PCI_DEVICE case is missing a break statement and falls
>> through to the following NOUVEAU_GETPARAM_BUS_TYPE case and may end up
>> re-assigning the getparam->value to an undesired value. Fix this by adding
>> in the missing break.
>>
>> Detected by CoverityScan, CID#1460507 ("Missing break in switch")
>>
>> Fixes: 359088d5b8ec ("drm/nouveau: remove trivial cases of nvxx_device() usage")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Reviewed-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Friendly ping:
> 
> Who can take this?
> 

BTW, this should be tagged for stable:

Cc: stable@vger.kernel.org

Thanks
--
Gustavo


>> ---
>>  drivers/gpu/drm/nouveau/nouveau_abi16.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c
>> index e67a471331b5..6ec745873bc5 100644
>> --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c
>> +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c
>> @@ -214,6 +214,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
>>  			WARN_ON(1);
>>  			break;
>>  		}
>> +		break;
>>  	case NOUVEAU_GETPARAM_FB_SIZE:
>>  		getparam->value = drm->gem.vram_available;
>>  		break;
>>

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

end of thread, other threads:[~2019-01-29 21:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 20:47 [PATCH] drm/nouveau: fix missing break in switch statement Colin King
2019-01-29 20:49 ` Gustavo A. R. Silva
2019-01-29 21:04   ` Gustavo A. R. Silva

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