linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference
@ 2012-09-18 11:50 Sachin Kamat
  2012-09-19  2:28 ` Inki Dae
  2012-09-19  2:49 ` Sachin Kamat
  0 siblings, 2 replies; 3+ messages in thread
From: Sachin Kamat @ 2012-09-18 11:50 UTC (permalink / raw)
  To: linux-fbdev

The error message printed when dsim is NULL references its member.
This will cause NULL pointer derefernce error. Hence change dev_err
to pr_err to avoid it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/video/exynos/exynos_mipi_dsi_common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c b/drivers/video/exynos/exynos_mipi_dsi_common.c
index 7cc4113..4fc64c4 100644
--- a/drivers/video/exynos/exynos_mipi_dsi_common.c
+++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
@@ -80,7 +80,7 @@ irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq, void *dev_id)
 	unsigned int intsrc, intmsk;
 
 	if (dsim = NULL) {
-		dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
+		pr_err("%s: wrong parameter\n", __func__);
 		return IRQ_NONE;
 	}
 
-- 
1.7.4.1


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

* RE: [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference
  2012-09-18 11:50 [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference Sachin Kamat
@ 2012-09-19  2:28 ` Inki Dae
  2012-09-19  2:49 ` Sachin Kamat
  1 sibling, 0 replies; 3+ messages in thread
From: Inki Dae @ 2012-09-19  2:28 UTC (permalink / raw)
  To: linux-fbdev



> -----Original Message-----
> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
> Sent: Tuesday, September 18, 2012 8:38 PM
> To: linux-fbdev@vger.kernel.org
> Cc: inki.dae@samsung.com; dh09.lee@samsung.com; FlorianSchandinat@gmx.de;
> sachin.kamat@linaro.org; patches@linaro.org
> Subject: [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer
> dereference
> 
> The error message printed when dsim is NULL references its member.
> This will cause NULL pointer derefernce error. Hence change dev_err
> to pr_err to avoid it.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/video/exynos/exynos_mipi_dsi_common.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c
> b/drivers/video/exynos/exynos_mipi_dsi_common.c
> index 7cc4113..4fc64c4 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi_common.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
> @@ -80,7 +80,7 @@ irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq,
> void *dev_id)
>  	unsigned int intsrc, intmsk;
> 
>  	if (dsim = NULL) {
> -		dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
> +		pr_err("%s: wrong parameter\n", __func__);
>  		return IRQ_NONE;
>  	}

Please, just remove above exception codes. dsim was allocated and already
checked by probe so this exception isn't needed.

Thanks,
Inki Dae


> 
> --
> 1.7.4.1


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

* Re: [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference
  2012-09-18 11:50 [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference Sachin Kamat
  2012-09-19  2:28 ` Inki Dae
@ 2012-09-19  2:49 ` Sachin Kamat
  1 sibling, 0 replies; 3+ messages in thread
From: Sachin Kamat @ 2012-09-19  2:49 UTC (permalink / raw)
  To: linux-fbdev

On 19 September 2012 07:58, Inki Dae <inki.dae@samsung.com> wrote:
>
>
>> -----Original Message-----
>> From: Sachin Kamat [mailto:sachin.kamat@linaro.org]
>> Sent: Tuesday, September 18, 2012 8:38 PM
>> To: linux-fbdev@vger.kernel.org
>> Cc: inki.dae@samsung.com; dh09.lee@samsung.com; FlorianSchandinat@gmx.de;
>> sachin.kamat@linaro.org; patches@linaro.org
>> Subject: [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer
>> dereference
>>
>> The error message printed when dsim is NULL references its member.
>> This will cause NULL pointer derefernce error. Hence change dev_err
>> to pr_err to avoid it.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> ---
>>  drivers/video/exynos/exynos_mipi_dsi_common.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c
>> b/drivers/video/exynos/exynos_mipi_dsi_common.c
>> index 7cc4113..4fc64c4 100644
>> --- a/drivers/video/exynos/exynos_mipi_dsi_common.c
>> +++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
>> @@ -80,7 +80,7 @@ irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq,
>> void *dev_id)
>>       unsigned int intsrc, intmsk;
>>
>>       if (dsim = NULL) {
>> -             dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
>> +             pr_err("%s: wrong parameter\n", __func__);
>>               return IRQ_NONE;
>>       }
>
> Please, just remove above exception codes. dsim was allocated and already
> checked by probe so this exception isn't needed.

Yes, that looks better if it is already ensured to be non-NULL. I had
not checked that.
Will remove this check and re-send.

Thanks.

>
> Thanks,
> Inki Dae
>
>
>>
>> --
>> 1.7.4.1
>



-- 
With warm regards,
Sachin

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

end of thread, other threads:[~2012-09-19  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-18 11:50 [PATCH 2/2] video: exynos_mipi_dsi: Fix potential NULL pointer dereference Sachin Kamat
2012-09-19  2:28 ` Inki Dae
2012-09-19  2:49 ` Sachin Kamat

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