Re: [PATCH RESEND] ntb_hw_switchtec: Fix ntb_mw_clear_trans returning error if size == 0

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

 



Ping?

CC: Jon Mason <jdmason@xxxxxxxx>
CC: Dave Jiang <dave.jiang@xxxxxxxxx>
CC: Allen Hubbe <allenbh@xxxxxxxxx>
CC: Kurt Schwemmer <kurt.schwemmer@xxxxxxxxxxxxx>
CC: Logan Gunthorpe <logang@xxxxxxxxxxxx>

On Wed, Jan 22, 2020 at 04:15:13PM +0300, Alexander Fomichev wrote:
> Somehow this patch was lost. The problem is still actual.
> Please, add to upstream.
> 
> On Wed, Jul 10, 2019 at 11:44:27AM +0300, Alexander Fomichev wrote:
> > ntb_mw_set_trans should work as ntb_mw_clear_trans when size == 0 and/or
> > addr == 0. But error in xlate_pos checking condition prevents this.
> > Fix the condition to make ntb_mw_clear_trans working.
> > 
> > Signed-off-by: Alexander Fomichev <fomichev.ru@xxxxxxxxx>
> > Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>
> > ---
> >  drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
> > index 1e2f627d3bac..19d46af19650 100644
> > --- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
> > +++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
> > @@ -299,7 +299,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx,
> >  	if (widx >= switchtec_ntb_mw_count(ntb, pidx))
> >  		return -EINVAL;
> >  
> > -	if (xlate_pos < 12)
> > +	if (size != 0 && xlate_pos < 12)
> >  		return -EINVAL;
> >  
> >  	if (!IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
> > -- 
> > 2.17.1
> 
> -- 
> Regards,
>   Alexander



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux