On Fri, Aug 25, 2017 at 01:36:00PM -0700, Bart Van Assche wrote:
>  
>       if (pg80_supported) {
> -retry_pg80:
> -             vpd_buf = kmalloc(vpd_len, GFP_KERNEL);
> -             if (!vpd_buf)
> -                     return;
> -
> -             result = scsi_vpd_inquiry(sdev, vpd_buf, 0x80, vpd_len);
> -             if (result < 0) {
> -                     kfree(vpd_buf);
> -                     return;
> -             }
> -             if (result > vpd_len) {
> -                     vpd_len = result;
> -                     kfree(vpd_buf);
> -                     goto retry_pg80;
> -             }
> +             vpd_buf = scsi_get_vpd_buf(sdev, 0x80, &vpd_len);
> +

The old code above did an early return when scsi_vpd_inquiry, so
contrary to the old description it does change behavior.

I think that needs to be fixed up.

Except for that this look slike a good cleanup.

Reply via email to