Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: dgnc: clean up the dgnc_get_modem_info()

the "ch" in dgnc_get_modem_info() was already checked before calling
this function and also if "ch" is not NULL, dgnc_get_mstat() returns
valid value so it doesn't need to check an error.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Daeseok Youn and committed by
Greg Kroah-Hartman
a5b90ef7 1b30ccde

+1 -11
+1 -11
drivers/staging/dgnc/dgnc_tty.c
··· 2020 2020 static int dgnc_get_modem_info(struct channel_t *ch, 2021 2021 unsigned int __user *value) 2022 2022 { 2023 - int result; 2024 - 2025 - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) 2026 - return -ENXIO; 2027 - 2028 - result = dgnc_get_mstat(ch); 2029 - 2030 - if (result < 0) 2031 - return -ENXIO; 2032 - 2033 - return put_user(result, value); 2023 + return put_user(dgnc_get_mstat(ch), value); 2034 2024 } 2035 2025 2036 2026 /*