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.

Reply via email to