diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2015-12-15 19:09:55 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-15 14:32:12 -0800 |
commit | a92a2d46acd0bfb97ba409d9d663c270cb240715 (patch) | |
tree | 247c0137fbba7dc82567c2e668d57d04af2dd1fa /drivers | |
parent | 5fbd1a0bcb02a2fda30849539dee0b91c4009c42 (diff) |
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 <rui.silva@linaro.org>
Reported-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/greybus/spi.c | 2 |
1 files changed, 2 insertions, 0 deletions
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++) { |