On 02/10/2014 03:15 PM, Christoph Hellwig wrote: > On Mon, Feb 10, 2014 at 12:11:39PM +0100, Hannes Reinecke wrote: >> + int vpd_len = 255; >> + unsigned char *buffer; >> +retry: >> + buffer = kmalloc(vpd_len, GFP_KERNEL); >> + if (!buffer) >> + return; >> + >> + ret = scsi_get_vpd_page(sdev, 0x83, buffer, vpd_len); >> + if (ret) { >> + kfree(buffer); >> + return; >> + } >> + >> + vpd_len = (buffer[2] << 8) + buffer[3]; >> + if (vpd_len > 255) { >> + kfree(buffer); >> + goto retry; > > Won't this create an infinite loop if the VPD is longer than 255 bytes? > Hmm. Sort of. Gnaa. Will be redoing the patch. Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@xxxxxxx +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html