Alan Stern wrote: > + int copy_len; ... > + copy_len = max((int) sdev->inquiry_len, 36); > + sdev->inquiry = kmalloc(copy_len, GFP_ATOMIC); > if (sdev->inquiry == NULL) { > return SCSI_SCAN_NO_RESPONSE; > } ... > + memcpy(sdev->inquiry, inq_result, copy_len); ... Can be written slightly more concise: sdev->inquiry = kmemdup(inq_result, max_t(size_t, sdev->inquiry_len, 36), GFP_ATOMIC); if (sdev->inquiry == NULL) return SCSI_SCAN_NO_RESPONSE; This is untested. kmemdup is only available since 2.6.19-rc1. -- Stefan Richter -=====-=-==- =-=- ====- http://arcgraph.de/sr/ - 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