All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Max Staudt <mstaudt@google.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Yunke Cao <yunkec@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] media: uvcvideo: Do not alloc dev->status
Date: Wed, 14 Dec 2022 09:39:58 +0900	[thread overview]
Message-ID: <Y5kbXt5lUqUiCmCi@google.com> (raw)
In-Reply-To: <20221212-uvc-race-v2-2-54496cc3b8ab@chromium.org>

On (22/12/13 15:35), Ricardo Ribalda wrote:
[..]
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -559,7 +559,7 @@ struct uvc_device {
>  	/* Status Interrupt Endpoint */
>  	struct usb_host_endpoint *int_ep;
>  	struct urb *int_urb;
> -	u8 *status;
> +	u8 status[UVC_MAX_STATUS_SIZE];

Can we use `struct uvc_control_status status;` instead of open-coding it?
Seems that this is what the code wants anyway:

	struct uvc_control_status *status =
				(struct uvc_control_status *)dev->status;

And then we can drop casts in uvc_status_complete().

  parent reply	other threads:[~2022-12-14  0:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 14:35 [PATCH v2 0/2] uvc: Fix race condition on uvc Ricardo Ribalda
2022-12-13 14:35 ` [PATCH v2 1/2] media: uvcvideo: Fix race condition with usb_kill_urb Ricardo Ribalda
2022-12-14  4:04   ` Yunke Cao
2022-12-13 14:35 ` [PATCH v2 2/2] media: uvcvideo: Do not alloc dev->status Ricardo Ribalda
2022-12-13 14:36   ` kernel test robot
2022-12-14  0:39   ` Sergey Senozhatsky [this message]
2022-12-14  5:57     ` Ricardo Ribalda
2022-12-14  6:02       ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5kbXt5lUqUiCmCi@google.com \
    --to=senozhatsky@chromium.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mstaudt@google.com \
    --cc=ribalda@chromium.org \
    --cc=stable@vger.kernel.org \
    --cc=yunkec@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.