public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver
@ 2013-05-07  3:39 Padmavathi Venna
  2013-05-07  9:03 ` Mark Brown
  2013-05-07  9:50 ` Tomasz Figa
  0 siblings, 2 replies; 4+ messages in thread
From: Padmavathi Venna @ 2013-05-07  3:39 UTC (permalink / raw)
  To: linux-arm-kernel

This patch fixes a null pointer deference in i2s driver in DT
case

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---

This patch is dependent on below patch posted by Thomas Abraham.
https://patchwork.kernel.org/patch/2224801/

 sound/soc/samsung/i2s.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 7ce7c50..eaf6439 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1182,7 +1182,7 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 		pri_dai->sec_dai = sec_dai;
 	}
 
-	if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
+	if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
 		dev_err(&pdev->dev, "Unable to configure gpio\n");
 		ret = -EINVAL;
 		goto err;
-- 
1.7.4.4

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

* [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver
  2013-05-07  3:39 [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver Padmavathi Venna
@ 2013-05-07  9:03 ` Mark Brown
  2013-05-07  9:50 ` Tomasz Figa
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-05-07  9:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, May 07, 2013 at 09:09:01AM +0530, Padmavathi Venna wrote:
> This patch fixes a null pointer deference in i2s driver in DT
> case
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> ---
> 
> This patch is dependent on below patch posted by Thomas Abraham.
> https://patchwork.kernel.org/patch/2224801/

Please don't submit patches that can't be applied, the two patches need
to be submitted together.  Please also remember to include human
readable descriptions of patches in e-mails for the benefit of human
readers, commit IDs and URLs aren't immediately comprehensible.

Please further note my new e-mail address.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130507/79a558c2/attachment.sig>

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

* [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver
  2013-05-07  3:39 [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver Padmavathi Venna
  2013-05-07  9:03 ` Mark Brown
@ 2013-05-07  9:50 ` Tomasz Figa
  2013-05-07 11:12   ` Padma Venkat
  1 sibling, 1 reply; 4+ messages in thread
From: Tomasz Figa @ 2013-05-07  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Padmavathi,

On Tuesday 07 of May 2013 09:09:01 Padmavathi Venna wrote:
> This patch fixes a null pointer deference in i2s driver in DT
> case
> 
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> ---
> 
> This patch is dependent on below patch posted by Thomas Abraham.
> https://patchwork.kernel.org/patch/2224801/
> 
>  sound/soc/samsung/i2s.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 7ce7c50..eaf6439 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -1182,7 +1182,7 @@ static int samsung_i2s_probe(struct platform_device
> *pdev) pri_dai->sec_dai = sec_dai;
>  	}
> 
> -	if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
> +	if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {

This is a problem that needs to be fixed indeed. However the same problem 
exists in samsung_i2s_remove() as well (at least in latest linux-next).

This makes me wonder what happens with i2s_pdata in DT case. Most of drivers 
allocate a pdata struct anyway and fill it with data parsed from device tree. 
This allows rest of the code to remain unmodified and consider DT and non-DT 
cases equal.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Kernel and System Framework

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

* [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver
  2013-05-07  9:50 ` Tomasz Figa
@ 2013-05-07 11:12   ` Padma Venkat
  0 siblings, 0 replies; 4+ messages in thread
From: Padma Venkat @ 2013-05-07 11:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tomasz,

On Tue, May 7, 2013 at 3:20 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> Hi Padmavathi,
>
> On Tuesday 07 of May 2013 09:09:01 Padmavathi Venna wrote:
>> This patch fixes a null pointer deference in i2s driver in DT
>> case
>>
>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>> ---
>>
>> This patch is dependent on below patch posted by Thomas Abraham.
>> https://patchwork.kernel.org/patch/2224801/
>>
>>  sound/soc/samsung/i2s.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
>> index 7ce7c50..eaf6439 100644
>> --- a/sound/soc/samsung/i2s.c
>> +++ b/sound/soc/samsung/i2s.c
>> @@ -1182,7 +1182,7 @@ static int samsung_i2s_probe(struct platform_device
>> *pdev) pri_dai->sec_dai = sec_dai;
>>       }
>>
>> -     if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
>> +     if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
>
> This is a problem that needs to be fixed indeed. However the same problem
> exists in samsung_i2s_remove() as well (at least in latest linux-next).

This will go off once Thomas "ASoC: samsung: let device core setup the
default pin configuration"
patch get merged.

>
> This makes me wonder what happens with i2s_pdata in DT case. Most of drivers
> allocate a pdata struct anyway and fill it with data parsed from device tree.
> This allows rest of the code to remain unmodified and consider DT and non-DT
> cases equal.

This driver doesn't allocate the i2s_pdata in DT case. It directly
parse the information form DT file
and assign that information to i2s_dai.

Thanks
Padma

>
> Best regards,
> --
> Tomasz Figa
> Samsung Poland R&D Center
> SW Solution Development, Kernel and System Framework
>

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

end of thread, other threads:[~2013-05-07 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-07  3:39 [PATCH] ASoC: Samsung: i2s: Fix crash in i2s driver Padmavathi Venna
2013-05-07  9:03 ` Mark Brown
2013-05-07  9:50 ` Tomasz Figa
2013-05-07 11:12   ` Padma Venkat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox