Re: [PATCH 01/15] scsi: allocate host device

Bart Van Assche
2021-11-25T23:18:48Z

On 11/25/21 7:10 AM, Hannes Reinecke wrote:
> +/**
> + * scsi_get_host_dev - Create a virtual scsi_device to the host adapter
^^^^^^
Attach?

> @@ -500,7 +500,8 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
> kfree_rcu(vpd_pg80, rcu);
> if (vpd_pg89)
> kfree_rcu(vpd_pg89, rcu);
> - kfree(sdev->inquiry);
> + if (!scsi_device_is_host_dev(sdev))
> + kfree(sdev->inquiry);
> kfree(sdev);

kfree() accepts a NULL pointer so please leave out the new if-test.

> -#define MODULE_ALIAS_SCSI_DEVICE(type) \
> +#define MODULE_ALIAS_SCSI_DEVICE(type) \
> MODULE_ALIAS("scsi:t-" __stringify(type) "*")

The above change seems not related to the rest of this patch? Can it be left out?

Otherwise this patch looks good to me.

Thanks,

Bart.