Re: [PATCH 5/5] esp_scsi: move dma mapping into the core code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 13, 2018 at 09:24:51AM +1100, Finn Thain wrote:
> >  	struct scatterlist *sg = scsi_sglist(cmd);
> > -	int dir = cmd->sc_data_direction;
> > -	int total, i;
> > +	int total = 0, i;
> >  
> > -	if (dir == DMA_NONE)
> > -		return;
> > -
> 
> Removing this DMA_NONE test caused an oops in my test. sg becomes a NULL 
> pointer.

Does it work if you add the check back?

> 
> > -	spriv->u.num_sg = esp->ops->map_sg(esp, sg, scsi_sg_count(cmd), dir);
> 
> Does anyone happen to know whether the union 'u' serves any purpose?

I don't think it does anymore.  It used to be SCSI commands with
a single segment didn't use struct scatterlist, so it might be relict
from that time.  I can throw in a patch that removes it.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux