mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 01:24:12 +08:00
scsi: virtio_scsi: Remove a useless function call
'inq_result' is known to be NULL. There is no point calling kfree(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
401f8ef319
commit
0e5e41ee3d
@ -338,10 +338,8 @@ static int virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi)
|
||||
int result, inquiry_len, inq_result_len = 256;
|
||||
char *inq_result = kmalloc(inq_result_len, GFP_KERNEL);
|
||||
|
||||
if (!inq_result) {
|
||||
kfree(inq_result);
|
||||
if (!inq_result)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
shost_for_each_device(sdev, shost) {
|
||||
inquiry_len = sdev->inquiry_len ? sdev->inquiry_len : 36;
|
||||
|
Loading…
Reference in New Issue
Block a user