From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: stern@rowland.harvard.edu
Cc: manjunath.goudar@linaro.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Subject: [PATCH] USB: OHCI: Only use ohci_driver_overrides if they are defined
Date: Tue, 15 Oct 2013 13:21:55 +0100 [thread overview]
Message-ID: <1381839715-2908-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
Overrides are optional and many drivers pass NULL, in this case don't
process the overrides so we don't deference a NULL pointer.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
drivers/usb/host/ohci-hcd.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 21d937a..e26abd5 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1161,6 +1161,9 @@ void ohci_init_driver(struct hc_driver *drv,
/* Copy the generic table to drv and then apply the overrides */
*drv = ohci_hc_driver;
+ if (!over)
+ return;
+
drv->product_desc = over->product_desc;
drv->hcd_priv_size += over->extra_priv_size;
if (over->reset)
--
1.7.2.5
next reply other threads:[~2013-10-15 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 12:21 Charles Keepax [this message]
2013-10-15 17:09 ` [PATCH] USB: OHCI: Only use ohci_driver_overrides if they are defined Charles Keepax
2013-10-15 20:13 ` Alan Stern
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=1381839715-2908-1-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=manjunath.goudar@linaro.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=stern@rowland.harvard.edu \
/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