Skip to content

Commit b0cdc4b

Browse files
bliu11-intelAnas Nashif
authored andcommitted
drivers: spi_shim: add return value check
Add function return value check. This was caught by Coverity. Coverity-CID: 157124 Change-Id: I93b23325d657dc787300908b9117b6976617fdba Signed-off-by: Baohong Liu <[email protected]>
1 parent a224a9a commit b0cdc4b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/spi/spi_qmsi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,13 @@ static struct device *gpio_cs_init(const struct spi_qmsi_config *config)
229229
if (!gpio)
230230
return NULL;
231231

232-
gpio_pin_configure(gpio, config->cs_pin, GPIO_DIR_OUT);
233-
gpio_pin_write(gpio, config->cs_pin, 1);
232+
if (gpio_pin_configure(gpio, config->cs_pin, GPIO_DIR_OUT) != 0) {
233+
return NULL;
234+
}
235+
236+
if (gpio_pin_write(gpio, config->cs_pin, 1) != 0) {
237+
return NULL;
238+
}
234239

235240
return gpio;
236241
}

0 commit comments

Comments
 (0)