From: Akinobu Mita Date: Thu, 7 Dec 2006 04:39:05 +0000 (-0800) Subject: [PATCH] spi: check platform_device_register_simple() error X-Git-Tag: v2.6.20-rc1~145^2^2~100 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7b92ff01c2cd21567c3342c1c77d5e4f1a2bd699;p=linux-2.6-omap-h63xx.git [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 --- diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c index c2f601f8e4f..312987a0321 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) {