From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Allison Randal <allison@lohutok.net>,
Steve Winslow <swinslow@gmail.com>,
Wen Yang <wen.yang99@zte.com.cn>,
Thomas Gleixner <tglx@linutronix.de>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] media: smsusb: better handle optional alignment
Date: Fri, 24 May 2019 21:09:41 +0200 [thread overview]
Message-ID: <20190524190941.GA18849@kroah.com> (raw)
In-Reply-To: <c53ea00f339529f69b89deac620e4ab540717eb9.1558709939.git.mchehab+samsung@kernel.org>
On Fri, May 24, 2019 at 10:59:43AM -0400, Mauro Carvalho Chehab wrote:
> Most Siano devices require an alignment for the response.
>
> Changeset f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb")
> changed the logic with gets such aligment, but it now produces a
> sparce warning:
>
> drivers/media/usb/siano/smsusb.c: In function 'smsusb_init_device':
> drivers/media/usb/siano/smsusb.c:447:37: warning: 'in_maxp' may be used uninitialized in this function [-Wmaybe-uninitialized]
> 447 | dev->response_alignment = in_maxp - sizeof(struct sms_msg_hdr);
> | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> The sparse message itself is bogus, but a broken (or fake) USB
> eeprom could produce a negative value for response_alignment.
>
> So, change the code in order to check if the result is not
> negative.
>
> Fixes: f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb")
> CC: <stable@vger.kernel.org>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
>
> Greg,
>
> As the Alan patches went via your tree, please apply this one too.
Thanks, now done, and I fixed up the Fixes: sha1 tag to match my tree.
greg k-h
next prev parent reply other threads:[~2019-05-24 19:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-24 14:59 [PATCH v2] media: smsusb: better handle optional alignment Mauro Carvalho Chehab
2019-05-24 19:09 ` Greg Kroah-Hartman [this message]
2019-05-24 19:22 ` Mauro Carvalho Chehab
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=20190524190941.GA18849@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=allison@lohutok.net \
--cc=mchehab+samsung@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=swinslow@gmail.com \
--cc=tglx@linutronix.de \
--cc=wen.yang99@zte.com.cn \
/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).