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? -- 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