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: firefly_0821_release~31885^2~14^2~108 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b92ff01c2cd21567c3342c1c77d5e4f1a2bd699;p=firefly-linux-kernel-4.4.55.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 c2f601f8e4f2..312987a03210 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) {