Re: [PATCH v2 1/2] Input: Add DaVinci DM365 Keypad support

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

 



David,

What are the proper error codes when platform_get_resource, request_mem_region and ioremap functions fail?.

Thanks,

Miguel Aguilar
David Brownell wrote:
On Monday 14 September 2009, miguel.aguilar@xxxxxxxxxxxx wrote:
+       dm365_kp = kzalloc(sizeof *dm365_kp, GFP_KERNEL);
+       key_dev = input_allocate_device();
+
+       if (!dm365_kp || !key_dev) {
+               dev_dbg(dev, "Could not allocate input device\n");
+               return -ENOMEM;
+       }

Can still leak the kzalloc'ed data...


+       dm365_kp->irq = platform_get_irq(pdev, 0);
+       if (dm365_kp->irq <= 0) {
+               dev_dbg(dev, "%s: No DM365 Keypad irq\n", pdev->name);
+               goto fail1;
+       }

Still discards the true fault codes here and later ...


+       printk(KERN_INFO "DaVinci DM365 Keypad Driver\n");

Nicer not to have such banners; a dev_info() in probe() is
better and won't show on boards where this driver isn't used.

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


--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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 Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux