On Sat, 10 Jun 2006, Arjan van de Ven wrote: > On Fri, 2006-06-09 at 22:25 +0200, Guennadi Liakhovetski wrote: > > + > > + if (cmd->use_sg) { > > + struct scatterlist* sg = (struct scatterlist *)cmd->request_buffer; > > + size_t offset = 0, len = sizeof(struct ScsiInqData); > > + > > + local_irq_save(flags); > > + base = scsi_kmap_atomic_sg(sg, cmd->use_sg, &offset, &len); > > + ptr = (struct ScsiInqData *)(base + offset); > > + } else > > + ptr = (struct ScsiInqData *)(cmd->request_buffer); > > hmm I wonder if the non-use-sg case can ever happen? Good question. I thought it would be better to be on the safe side. > (and if that irq_save isn't leaking here) AFAICS, no. Looks like use_sg is constant throughout scsi_cmnd's life-cycle, apart from error-handling. Thanks Guennadi --- Guennadi Liakhovetski - : 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