mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: check platform_device_register_simple() error
@ 2006-11-27  5:09 Akinobu Mita
  2006-11-27 18:28 ` David Brownell
  2006-11-28  0:08 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Akinobu Mita @ 2006-11-27  5:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Brownell

This patch checks the return value of platform_device_register_simple().

Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 drivers/spi/spi_butterfly.c |    2 ++
 1 file changed, 2 insertions(+)

Index: work-fault-inject/drivers/spi/spi_butterfly.c
===================================================================
--- work-fault-inject.orig/drivers/spi/spi_butterfly.c
+++ work-fault-inject/drivers/spi/spi_butterfly.c
@@ -250,6 +250,8 @@ static void butterfly_attach(struct parp
 	 * setting up a platform device like this is an ugly kluge...
 	 */
 	pdev = platform_device_register_simple("butterfly", -1, NULL, 0);
+	if (IS_ERR(pdev))
+		return;
 
 	master = spi_alloc_master(&pdev->dev, sizeof *pp);
 	if (!master) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-28  0:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-27  5:09 [PATCH] spi: check platform_device_register_simple() error Akinobu Mita
2006-11-27 18:28 ` David Brownell
2006-11-28  0:08 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®