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] [thread-next>] [day] [month] [year] [list]
Message-ID: <293a35ea-332f-3ed6-8060-bbde3ac53fa6@suse.de>
Date:   Mon, 5 Sep 2022 10:42:05 +0200
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Takashi Iwai <tiwai@...e.de>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/12] drm/udl: Don't re-initialize stuff at retrying the
 URB list allocation



Am 16.08.22 um 17:36 schrieb Takashi Iwai:
> udl_alloc_urb_list() retires the allocation if there is no enough room
> left, and it reinitializes the stuff unnecessarily such as the linked
> list head and the waitqueue, which could be harmful.  Those should be
> outside the retry loop.
> 
> Signed-off-by: Takashi Iwai <tiwai@...e.de>

Acked-by: Thomas Zimmermann <tzimmermann@...e.de>

> ---
>   drivers/gpu/drm/udl/udl_main.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
> index 19dc8317e843..c1f4b6199949 100644
> --- a/drivers/gpu/drm/udl/udl_main.c
> +++ b/drivers/gpu/drm/udl/udl_main.c
> @@ -187,15 +187,14 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
>   	struct usb_device *udev = udl_to_usb_device(udl);
>   
>   	spin_lock_init(&udl->urbs.lock);
> -
> -retry:
> -	udl->urbs.size = size;
>   	INIT_LIST_HEAD(&udl->urbs.list);
> -
>   	init_waitqueue_head(&udl->urbs.sleep);
>   	udl->urbs.count = 0;
>   	udl->urbs.available = 0;
>   
> +retry:
> +	udl->urbs.size = size;
> +
>   	while (udl->urbs.count * size < wanted_size) {
>   		unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL);
>   		if (!unode)

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ