linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] USB: usblp: fix DMA to stack
Date: Wed, 6 Jan 2021 12:25:25 +0100	[thread overview]
Message-ID: <X/WeJfWKtFEebpMC@hovoldconsulting.com> (raw)
In-Reply-To: <20210104113736.0af1ce0a@suzdal.zaitcev.lan>

On Mon, Jan 04, 2021 at 11:37:36AM -0600, Pete Zaitcev wrote:
> On Mon,  4 Jan 2021 15:53:02 +0100
> Johan Hovold <johan@kernel.org> wrote:
> 
> > +++ b/drivers/usb/class/usblp.c
> > -#define usblp_hp_channel_change_request(usblp, channel, buffer) \
> > -	usblp_ctrl_msg(usblp, USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST, USB_TYPE_VENDOR, USB_DIR_IN, USB_RECIP_INTERFACE, channel, buffer, 1)
> > +static int usblp_hp_channel_change_request(struct usblp *usblp, int channel, u8 *new_channel)
> 
> Acked-By: Pete Zaitcev <zaitcev@redhat.com>
> 
> I would probably get rid of the buffer pointer and return
> new_channel & 0xFF in case of success. That would kill
> the newChannel too, and there's no need to debage u8 versus
> unsigned char. But this is good enough. A function is better
> than trying to cram the kfree() into the clause of the switch.

Yeah, I wanted a minimal change suitable for stable and the helper was
already there to be used for this.

Johan

      reply	other threads:[~2021-01-06 11:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 14:53 [PATCH] USB: usblp: fix DMA to stack Johan Hovold
2021-01-04 14:59 ` Greg Kroah-Hartman
2021-01-04 15:11   ` Johan Hovold
2021-01-04 15:33     ` Michael Sweet
2021-01-04 15:48       ` Johan Hovold
2021-01-04 17:37 ` Pete Zaitcev
2021-01-06 11:25   ` Johan Hovold [this message]

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=X/WeJfWKtFEebpMC@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).