linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
@ 2017-07-31  4:31 Keerthy
  2017-07-31 20:09 ` Santosh Shilimkar
  2017-08-21  5:44 ` santosh.shilimkar
  0 siblings, 2 replies; 4+ messages in thread
From: Keerthy @ 2017-07-31  4:31 UTC (permalink / raw)
  To: ssantosh, m-karicheri2
  Cc: t-kristo, linux-arm-kernel, linux-kernel, j-keerthy

knav_pool_create is an exported function. In the event of a call
before knav_queue_probe, we encounter a NULL pointer dereference
in the following line. Hence return -EPROBE_DEFER to the caller till
the kdev pointer is non-NULL.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Changes in v2:

  * Fixed returning an int to returning pointer.

 drivers/soc/ti/knav_qmss_queue.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 279e7c5..d91626b 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -745,6 +745,9 @@ void *knav_pool_create(const char *name,
 	bool slot_found;
 	int ret;
 
+	if (!kdev)
+		return ERR_PTR(-EPROBE_DEFER);
+
 	if (!kdev->dev)
 		return ERR_PTR(-ENODEV);
 
-- 
1.9.1

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

* Re: [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
  2017-07-31  4:31 [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create Keerthy
@ 2017-07-31 20:09 ` Santosh Shilimkar
  2017-08-21  5:44 ` santosh.shilimkar
  1 sibling, 0 replies; 4+ messages in thread
From: Santosh Shilimkar @ 2017-07-31 20:09 UTC (permalink / raw)
  To: Keerthy; +Cc: ssantosh, m-karicheri2, t-kristo, linux-arm-kernel, linux-kernel

On 7/30/2017 9:31 PM, Keerthy wrote:
> knav_pool_create is an exported function. In the event of a call
> before knav_queue_probe, we encounter a NULL pointer dereference
> in the following line. Hence return -EPROBE_DEFER to the caller till
> the kdev pointer is non-NULL.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> Changes in v2:
> 
>    * Fixed returning an int to returning pointer.

Thanks. Will add it to the queue.

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

* Re: [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
  2017-07-31  4:31 [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create Keerthy
  2017-07-31 20:09 ` Santosh Shilimkar
@ 2017-08-21  5:44 ` santosh.shilimkar
  2017-08-21  7:21   ` Arnd Bergmann
  1 sibling, 1 reply; 4+ messages in thread
From: santosh.shilimkar @ 2017-08-21  5:44 UTC (permalink / raw)
  To: arm, Arnd Bergmann
  Cc: Keerthy, ssantosh, m-karicheri2, t-kristo, linux-arm-kernel,
	linux-kernel

Hi Arnd,

On 7/30/17 9:31 PM, Keerthy wrote:
> knav_pool_create is an exported function. In the event of a call
> before knav_queue_probe, we encounter a NULL pointer dereference
> in the following line. Hence return -EPROBE_DEFER to the caller till
> the kdev pointer is non-NULL.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
> 
> Changes in v2:
> 
>    * Fixed returning an int to returning pointer.
FWIW, Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

Can you please also apply this fix in your fixes branch ?

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

* Re: [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create
  2017-08-21  5:44 ` santosh.shilimkar
@ 2017-08-21  7:21   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-08-21  7:21 UTC (permalink / raw)
  To: santosh.shilimkar
  Cc: arm, Keerthy, Santosh Shilimkar, Murali Karicheri, Tero Kristo,
	Linux ARM, Linux Kernel Mailing List

On Mon, Aug 21, 2017 at 7:44 AM, santosh.shilimkar@oracle.com
<santosh.shilimkar@oracle.com> wrote:
> Hi Arnd,
>
> On 7/30/17 9:31 PM, Keerthy wrote:
>>
>> knav_pool_create is an exported function. In the event of a call
>> before knav_queue_probe, we encounter a NULL pointer dereference
>> in the following line. Hence return -EPROBE_DEFER to the caller till
>> the kdev pointer is non-NULL.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>
>> Changes in v2:
>>
>>    * Fixed returning an int to returning pointer.
>
> FWIW, Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
>
> Can you please also apply this fix in your fixes branch ?

Applied now, thanks!

      Arnd

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

end of thread, other threads:[~2017-08-21  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-31  4:31 [PATCH v2] soc: ti: knav: Add a NULL pointer check for kdev in knav_pool_create Keerthy
2017-07-31 20:09 ` Santosh Shilimkar
2017-08-21  5:44 ` santosh.shilimkar
2017-08-21  7:21   ` Arnd Bergmann

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