From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-usb@vger.kernel.org, stable <stable@vger.kernel.org>
Subject: Re: [PATCH v2] USB: serial: quatech2: handle unbound ports
Date: Fri, 17 Jan 2020 16:02:23 +0100 [thread overview]
Message-ID: <20200117150223.GB1898895@kroah.com> (raw)
In-Reply-To: <20200117143526.5048-1-johan@kernel.org>
On Fri, Jan 17, 2020 at 03:35:26PM +0100, Johan Hovold wrote:
> Check for NULL port data in the modem- and line-status handlers to avoid
> dereferencing a NULL pointer in the unlikely case where a port device
> isn't bound to a driver (e.g. after an allocation failure on port
> probe).
>
> Note that the other (stubbed) event handlers qt2_process_xmit_empty()
> and qt2_process_flush() would need similar sanity checks in case they
> are ever implemented.
>
> Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
> Cc: stable <stable@vger.kernel.org> # 3.5
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>
> v2
> - move sanity checks to where the actual dereferences take place
> - drop sanity checks from the stubbed event handlers
Looks good, thanks for the rewrite:
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
prev parent reply other threads:[~2020-01-17 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 14:35 [PATCH v2] USB: serial: quatech2: handle unbound ports Johan Hovold
2020-01-17 15:02 ` Greg Kroah-Hartman [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=20200117150223.GB1898895@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stable@vger.kernel.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 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).