lkml.org 
[lkml]   [2017]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH] PM / devfreq: Fix potential NULL pointer dereference in governor_store
From
Date
> df->governor is being dereferenced before it is null checked,
> hence there is a potential null pointer dereference.
>
> Notice that df->governor is being null checked at line 1004:
> if (df->governor) {, which implies it might be null.
>
> Fix this by null checking df->governor before dereferencing it.
>
> Addresses-Coverity-ID: 1401988 ("Dereference before null check")
> Fixes: bcf23c79c4e4 ("PM / devfreq: Fix available_governor sysfs")
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>


Cheers,
MyungJoo

> ---
> drivers/devfreq/devfreq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 78fb496..14fe76b 100644

\
 
 \ /
  Last update: 2017-12-07 03:43    [W:0.079 / U:8.420 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site