ota_crypto: Add NULL pointer check for new_req variable

Add NULL pointer check before accessing the new_req
variable.

Change-Id: I8460115ccb16a2c43c45394275e9519ed3c6b045
Signed-off-by: Brahmaji K <bkomma@codeaurora.org>
This commit is contained in:
Brahmaji K 2017-05-05 16:58:52 +05:30
parent 3d82d66409
commit 0ef4f1a1b8

View file

@ -239,6 +239,9 @@ static void req_done(unsigned long data)
if (!list_empty(&podev->ready_commands)) {
new_req = container_of(podev->ready_commands.next,
struct ota_async_req, rlist);
if (!new_req)
break;
list_del(&new_req->rlist);
pqce->active_command = new_req;
spin_unlock_irqrestore(&podev->lock, flags);