From: Rui Miguel Silva Date: Tue, 15 Dec 2015 19:09:55 +0000 (+0000) Subject: greybus: spi: validate spi master register X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a92a2d46acd0bfb97ba409d9d663c270cb240715;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: spi: validate spi master register Check for error in registering spi master, even though the current code will fail a little more ahead when trying to register devices in the master. Signed-off-by: Rui Miguel Silva Reported-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/spi.c b/drivers/staging/greybus/spi.c index 41aa0ec1ced7..6e1146d474df 100644 --- a/drivers/staging/greybus/spi.c +++ b/drivers/staging/greybus/spi.c @@ -360,6 +360,8 @@ static int gb_spi_connection_init(struct gb_connection *connection) master->transfer_one_message = gb_spi_transfer_one_message; ret = spi_register_master(master); + if (ret < 0) + goto out_put_master; /* now, fetch the devices configuration */ for (i = 0; i < spi->num_chipselect; i++) {