lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 16 Sep 2020 14:22:06 +0200
From:   Jérôme Pouiller <jerome.pouiller@...abs.com>
To:     trix@...hat.com, Greg KH <gregkh@...uxfoundation.org>
Cc:     devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: wfx: simplify virt_addr_valid call

On Wednesday 16 September 2020 13:11:59 CEST Greg KH wrote:
> On Sat, Sep 12, 2020 at 07:47:19AM -0700, trix@...hat.com wrote:
> > From: Tom Rix <trix@...hat.com>
> >
> > Reviewing sram_write_dma_safe(), there are two
> > identical calls to virt_addr_valid().  The second
> > call can be simplified by a comparison of variables
> > set from the first call.
> >
> > Signed-off-by: Tom Rix <trix@...hat.com>
> > ---
> >  drivers/staging/wfx/fwio.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
> > index 22d3b684f04f..c99adb0c99f1 100644
> > --- a/drivers/staging/wfx/fwio.c
> > +++ b/drivers/staging/wfx/fwio.c
> > @@ -94,7 +94,7 @@ static int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf,
> >               tmp = buf;
> >       }
> >       ret = sram_buf_write(wdev, addr, tmp, len);
> > -     if (!virt_addr_valid(buf))
> > +     if (tmp != buf)
> >               kfree(tmp);
> >       return ret;
> >  }
> 
> Jerome, any thoughts?

Looks correct.

Reviewed-by: Jérôme Pouiller <jerome.pouiller@...abs.com>

-- 
Jérôme Pouiller


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ