[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <TYCPR01MB5581998AD64AE249C7D86C26D46D9@TYCPR01MB5581.jpnprd01.prod.outlook.com>
Date: Mon, 6 Dec 2021 23:19:36 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Ameer Hamza <amhamza.mgc@...il.com>
CC: "lgirdwood@...il.com" <lgirdwood@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] ASoC: test-component: fix null pointer dereference.
Hi Ameer
>> Probing this driver without adata is strange for me.
>> How did probe this driver ??
>
> Thank you for your response. Unfortunately, I am not aware of
> implementation details of this component. Coverity suggested that there
> can be a potential NULL pointer access which seems logical to me. Do you
> agree with coverity here?
I think no potential NULL pointer access, because this driver can't
be called without of_id->data.
But, potential NULL pointer check itself is good idea.
It seems your patch was already accepted :)
I noticed that we can replace it to use of_device_get_match_data()
- const struct of_device_id *of_id = of_match_device(test_of_match, &pdev->dev);
- const struct test_adata *adata = of_id->data;
+ const struct test_adata *adata = of_device_get_match_data(&pdev->dev);
Best regards
---
Kuninori Morimoto
Powered by blists - more mailing lists