[PATCH 19/25] From adaf82b13fbf863c85a192c55935b07c99315876 Mon Sep 17 00:00:00 2001

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hao Wu <hao.wu@xxxxxxxxx>

Subject: [PATCH] USB OTG Langwell: Fix missing init_timer and add pointer check in timer init.

This patch added missed init_timer function for kernel timer of stata machine.
and add pointer check for timer kmalloc.

 modified:   drivers/usb/otg/langwell_otg.c

Signed-off-by: Hao Wu <hao.wu@xxxxxxxxx>
Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
---

 drivers/usb/otg/langwell_otg.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
index 83d7941..4378c64 100644
--- a/drivers/usb/otg/langwell_otg.c
+++ b/drivers/usb/otg/langwell_otg.c
@@ -122,6 +122,9 @@ static inline struct langwell_otg_timer *otg_timer_initializer
 {
 	struct langwell_otg_timer *timer;
 	timer = kmalloc(sizeof(struct langwell_otg_timer), GFP_KERNEL);
+	if (timer == NULL)
+		return timer;
+
 	timer->function = function;
 	timer->expires = expires;
 	timer->data = data;
@@ -2018,6 +2021,7 @@ static int langwell_otg_probe(struct pci_dev *pdev,
 		goto err;
 	}
 
+	init_timer(&langwell->hsm_timer);
 	if (request_irq(pdev->irq, otg_irq, IRQF_SHARED,
 				driver_name, langwell) != 0) {
 		dev_dbg(&pdev->dev, "request interrupt %d failed\n", pdev->irq);

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux