mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
target: Fix target_sense_desc_format NULL pointer dereference
This patch allows target_sense_desc_format() to be called without a
valid se_device pointer, which can occur during an early exception
ahead of transport_lookup_cmd_lun() setting up se_cmd->se_device.
This addresses a v4.3-rc1 specific NULL pointer dereference
regression introduced by commit 4e4937e8.
Cc: Sagi Grimberg <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
eeeb952223
commit
f3bb467ff6
1 changed files with 1 additions and 1 deletions
|
|
@ -187,5 +187,5 @@ core_delete_hba(struct se_hba *hba)
|
|||
|
||||
bool target_sense_desc_format(struct se_device *dev)
|
||||
{
|
||||
return dev->transport->get_blocks(dev) > U32_MAX;
|
||||
return (dev) ? dev->transport->get_blocks(dev) > U32_MAX : false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue