From: Mark Hounschell Date: Fri, 25 Apr 2014 17:10:18 +0000 (-0400) Subject: staging: dgap: check unchecked return values X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7496e0538666012b89d2280f3f6681345002a454;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: dgap: check unchecked return values Check the return values of dgap_tty_register and dgap_finalize_board_init. If they fail for a particular board we should not be able to try to use that board. IE. no device entries shall be created for that board. Signed-off-by: Mark Hounschell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 3b732380f9e6..2c7acee6c926 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -882,8 +882,13 @@ static int dgap_firmware_load(struct pci_dev *pdev, int card_type) return -EINVAL; } - dgap_tty_register(brd); - dgap_finalize_board_init(brd); + ret = dgap_tty_register(brd); + if (ret) + return ret; + + ret = dgap_finalize_board_init(brd); + if (ret) + return ret; if (fw_info[card_type].bios_name) { ret = request_firmware(&fw, fw_info[card_type].bios_name,