linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: gregkh@linuxfoundation.org
Cc: stern@rowland.harvard.edu, mail@beyermatthias.de,
	hdegoede@redhat.com, sarah.a.sharp@linux.intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	rostedt@goodmis.org, Sasha Levin <sasha.levin@oracle.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH] usb-core: Revert "usb-core: Remove Fix mes in file hcd.c"
Date: Wed, 23 Jul 2014 08:56:10 -0400	[thread overview]
Message-ID: <1406120170-22983-1-git-send-email-sasha.levin@oracle.com> (raw)

Revert since the commit message is incorrect and the original author refuses
to fix/maintain it because "it's in the kernel already".

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/core/hcd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 487abcf..bec31e2 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -855,6 +855,8 @@ static ssize_t authorized_default_show(struct device *dev,
 	struct usb_bus *usb_bus = rh_usb_dev->bus;
 	struct usb_hcd *usb_hcd;
 
+	if (usb_bus == NULL)	/* FIXME: not sure if this case is possible */
+		return -ENODEV;
 	usb_hcd = bus_to_hcd(usb_bus);
 	return snprintf(buf, PAGE_SIZE, "%u\n", usb_hcd->authorized_default);
 }
@@ -869,6 +871,8 @@ static ssize_t authorized_default_store(struct device *dev,
 	struct usb_bus *usb_bus = rh_usb_dev->bus;
 	struct usb_hcd *usb_hcd;
 
+	if (usb_bus == NULL)	/* FIXME: not sure if this case is possible */
+		return -ENODEV;
 	usb_hcd = bus_to_hcd(usb_bus);
 	result = sscanf(buf, "%u\n", &val);
 	if (result == 1) {
-- 
1.9.1


             reply	other threads:[~2014-07-23 12:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 12:56 Sasha Levin [this message]
2014-07-23 16:49 ` [PATCH] usb-core: Revert "usb-core: Remove Fix mes in file hcd.c" Greg KH
2014-07-24 13:14   ` Sasha Levin
2014-07-24 16:04     ` Greg KH
2014-07-24 16:20       ` Sasha Levin
2014-07-24 20:56         ` Greg KH

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=1406120170-22983-1-git-send-email-sasha.levin@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mail@beyermatthias.de \
    --cc=rostedt@goodmis.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=sashal@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).