# \[PATCH v2 2/2\] video: exynos\_mipi\_dsi: Remove unnecessary NULL check

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- List: linux-fbdev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-fbdev/2012/09/13463914/t

## \[PATCH v2 2/2\] video: exynos\_mipi\_dsi: Remove unnecessary NULL check

- From: Sachin Kamat \<hidden\>
- Date: 2012-09-21 05:18:47 
- Message: https://ratatoskr.run/linux-fbdev/2012/09/13463914.md

```text
'dsim' is allocated and checked for NULL in the probe function.
Hence this check is redundant. This cleanup also fixes a potential NULL
pointer dereference error when dsim which is NULL references its member
in the error print message.

Signed-off-by: Sachin Kamat <redacted>
---
 drivers/video/exynos/exynos_mipi_dsi_common.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c b/drivers/video/exynos/exynos_mipi_dsi_common.c
index 7cc4113..3cd29a4 100644
--- a/drivers/video/exynos/exynos_mipi_dsi_common.c
+++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
@@ -79,11 +79,6 @@ irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq, void *dev_id)
 	struct mipi_dsim_device *dsim = dev_id;
 	unsigned int intsrc, intmsk;
 
-	if (dsim = NULL) {
-		dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
-		return IRQ_NONE;
-	}
-
 	intsrc = exynos_mipi_dsi_read_interrupt(dsim);
 	intmsk = exynos_mipi_dsi_read_interrupt_mask(dsim);
 	intmsk = ~intmsk & intsrc;
-- 
1.7.4.1

```

## RE: \[PATCH v2 2/2\] video: exynos\_mipi\_dsi: Remove unnecessary NULL check

- From: Inki Dae \<inki.dae@samsung.com\>
- Date: 2012-09-21 06:01:52 
- Message: https://ratatoskr.run/linux-fbdev/2012/09/13463915.md

```text
Acked-by: Inki Dae <inki.dae@samsung.com>

> -----Original Message-----
> From: Sachin Kamat [mailto:<redacted>]
> Sent: Friday, September 21, 2012 2:07 PM
> To: <redacted>
> Cc: inki.dae@samsung.com; FlorianSchandinat@gmx.de;
> sachin.kamat@linaro.org; patches@linaro.org
> Subject: [PATCH v2 2/2] video: exynos_mipi_dsi: Remove unnecessary NULL
> check
> 
> 'dsim' is allocated and checked for NULL in the probe function.
> Hence this check is redundant. This cleanup also fixes a potential NULL
> pointer dereference error when dsim which is NULL references its member
> in the error print message.
> 
> Signed-off-by: Sachin Kamat <redacted>
> ---
>  drivers/video/exynos/exynos_mipi_dsi_common.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/video/exynos/exynos_mipi_dsi_common.c
> b/drivers/video/exynos/exynos_mipi_dsi_common.c
> index 7cc4113..3cd29a4 100644
> --- a/drivers/video/exynos/exynos_mipi_dsi_common.c
> +++ b/drivers/video/exynos/exynos_mipi_dsi_common.c
> @@ -79,11 +79,6 @@ irqreturn_t exynos_mipi_dsi_interrupt_handler(int irq,
> void *dev_id)
>  	struct mipi_dsim_device *dsim = dev_id;
>  	unsigned int intsrc, intmsk;
> 
> -	if (dsim = NULL) {
> -		dev_err(dsim->dev, "%s: wrong parameter\n", __func__);
> -		return IRQ_NONE;
> -	}
> -
>  	intsrc = exynos_mipi_dsi_read_interrupt(dsim);
>  	intmsk = exynos_mipi_dsi_read_interrupt_mask(dsim);
>  	intmsk = ~intmsk & intsrc;
> --
> 1.7.4.1

```
