Skip to content

Commit

Permalink
greybus: spi: validate spi master register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rui Miguel Silva authored and Greg Kroah-Hartman committed Dec 15, 2015
1 parent 5fbd1a0 commit a92a2d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/greybus/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit a92a2d4

Please sign in to comment.