lkml.org 
[lkml]   [2018]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: greybus: Fix null pointer dereference
Date
If fw is null then fw->size will trigger null pointer dereference

Signed-off-by: Ding Xiang <dingxiang@cmss.chinamobile.com>
---
drivers/staging/greybus/bootrom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c
index e85ffae..3af28a0 100644
--- a/drivers/staging/greybus/bootrom.c
+++ b/drivers/staging/greybus/bootrom.c
@@ -297,7 +297,7 @@ static int gb_bootrom_get_firmware(struct gb_operation *op)

queue_work:
/* Refresh timeout */
- if (!ret && (offset + size == fw->size))
+ if (!ret && fw && (offset + size == fw->size))
next_request = NEXT_REQ_READY_TO_BOOT;
else
next_request = NEXT_REQ_GET_FIRMWARE;
--
1.8.3.1


\
 
 \ /
  Last update: 2018-08-24 04:56    [W:0.034 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site