From 7b92ff01c2cd21567c3342c1c77d5e4f1a2bd699 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Wed, 6 Dec 2006 20:39:05 -0800 Subject: [PATCH] [PATCH] spi: check platform_device_register_simple() error Check the return value of platform_device_register_simple(). Cc: David Brownell Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spi_butterfly.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c index c2f601f8e4..312987a032 100644 --- a/drivers/spi/spi_butterfly.c +++ b/drivers/spi/spi_butterfly.c @@ -251,6 +251,8 @@ static void butterfly_attach(struct parport *p) * 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) { -- 2.39.5