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-next>] [day] [month] [year] [list]
Message-ID: <1490129435.403938.1627412276697@mail.yahoo.com>
Date:   Tue, 27 Jul 2021 18:57:56 +0000 (UTC)
From:   Hin-Tak Leung <htl10@...rs.sourceforge.net>
To:     Kalle Valo <kvalo@...eaurora.org>
Cc:     Herton Ronaldo Krzesinski <herton@...onical.com>,
        Larry Finger <larry.finger@...inger.net>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, gregkh@...uxfoundation.org,
        Salah Triki <salah.triki@...il.com>,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] wireless: rtl8187: replace udev with usb_get_dev()

> > On Saturday, 24 July 2021, 19:35:12 BST, Salah Triki <salah.triki@...il.com> wrote:
> >
> >> Replace udev with usb_get_dev() in order to make code cleaner.
> >
> >> Signed-off-by: Salah Triki <salah.triki@...il.com>

Nacked-by: Hin-Tak Leung <htl10@...rs.sourceforge.net>

Seeing as the change does not add any value.

> >> ---
> >> drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c | 4 +---
> >> 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> >> diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
> > b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
> >> index eb68b2d3caa1..30bb3c2b8407 100644
> >> --- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
> >> +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
> >> @@ -1455,9 +1455,7 @@ static int rtl8187_probe(struct usb_interface *intf,
> >
> >>    SET_IEEE80211_DEV(dev, &intf->dev);
> >>    usb_set_intfdata(intf, dev);
> >> -    priv->udev = udev;
> >> -
> >> -    usb_get_dev(udev);
> >> +    priv->udev = usb_get_dev(udev);
> >
> >>    skb_queue_head_init(&priv->rx_queue);
> >
> >> -- 
> >> 2.25.1
> >
> > It is not cleaner - the change is not functionally equivalent. Before
> > the change, the reference count is increased after the assignment; and
> > after the change, before the assignment. So my question is, does the
> > reference count increasing a little earlier matters? What can go wrong
> > between very short time where the reference count increases, and
> > priv->udev not yet assigned? I think there might be a race condition
> > where the probbe function is called very shortly twice. Especially if
> > the time of running the reference count function is non-trivial.
> >
> > Larry, what do you think?


> BTW, please don't use HTML in emails. Our lists drop all HTML mail (and
for a good reason).

Yes, sorry about that (I got a few bounces). Yahoo (where this is coming from) seems to make it quite hard to send plain non-html e-mails. See if this one gets through.


> -- 
> https://patchwork.kernel.org/project/linux-wireless/list/

> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ