All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Gromm <christian.gromm@microchip.com>
To: <gregkh@linuxfoundation.org>
Cc: Christian Gromm <christian.gromm@microchip.com>,
	driverdev-devel@linuxdriverproject.org
Subject: [PATCH v4 07/10] staging: most: usb: check for NULL device
Date: Thu, 23 Jan 2020 16:38:23 +0100	[thread overview]
Message-ID: <1579793906-5054-8-git-send-email-christian.gromm@microchip.com> (raw)
In-Reply-To: <1579793906-5054-1-git-send-email-christian.gromm@microchip.com>

Check if the dci structer has been allocated before trying to release it.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
v3:
	This patch has beed added to the series.
v4:

 drivers/staging/most/usb/usb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index 3c8ae17..857f916 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -1217,7 +1217,8 @@ static void hdm_disconnect(struct usb_interface *interface)
 	del_timer_sync(&mdev->link_stat_timer);
 	cancel_work_sync(&mdev->poll_work_obj);
 
-	device_unregister(&mdev->dci->dev);
+	if (mdev->dci)
+		device_unregister(&mdev->dci->dev);
 	most_deregister_interface(&mdev->iface);
 
 	kfree(mdev->busy_urbs);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-01-23 15:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 15:38 [PATCH v4 00/10] staging: most: move core module out of staging Christian Gromm
2020-01-23 15:38 ` [PATCH v4 01/10] staging: most: remove device from interface structure Christian Gromm
2020-01-23 18:18   ` Greg KH
2020-01-24  8:56     ` Christian.Gromm
2020-01-24  9:09       ` Greg KH
2020-02-06  9:14         ` Christian.Gromm
2020-02-14 16:17           ` Greg KH
2020-03-23 14:16         ` Christian.Gromm
2020-01-23 15:38 ` [PATCH v4 02/10] staging: most: core: drop device reference Christian Gromm
2020-01-23 15:38 ` [PATCH v4 03/10] staging: most: remove struct device core driver Christian Gromm
2020-01-23 15:38 ` [PATCH v4 04/10] staging: most: core: remove container struct Christian Gromm
2020-01-23 15:38 ` [PATCH v4 05/10] staging: most: core: fix logging messages Christian Gromm
2020-01-23 15:38 ` [PATCH v4 06/10] staging: next: configfs: fix release link Christian Gromm
2020-01-23 15:38 ` Christian Gromm [this message]
2020-01-23 15:38 ` [PATCH v4 08/10] staging: most: move core files out of the staging area Christian Gromm
2020-01-23 15:38 ` [PATCH v4 09/10] staging: most: Documentation: update ABI description Christian Gromm
2020-01-23 15:38 ` [PATCH v4 10/10] staging: most: Documentation: move ABI description files out of staging area Christian Gromm

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=1579793906-5054-8-git-send-email-christian.gromm@microchip.com \
    --to=christian.gromm@microchip.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.