Commit 1931743
tty: n_gsm: fix sometimes uninitialized warning in gsm_dlci_modem_output()
'size' may be used uninitialized in gsm_dlci_modem_output() if called with
an adaption that is neither 1 nor 2. The function is currently only called
by gsm_modem_upd_via_data() and only for adaption 2.
Properly handle every invalid case by returning -EINVAL to silence the
compiler warning and avoid future regressions.
Fixes: c19ffe0 ("tty: n_gsm: fix invalid use of MSC in advanced option")
Cc: [email protected]
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Daniel Starke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 637674f commit 1931743
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
| 935 | + | |
936 | 936 | | |
937 | 937 | | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
942 | 943 | | |
943 | 944 | | |
944 | | - | |
| 945 | + | |
| 946 | + | |
945 | 947 | | |
946 | 948 | | |
| 949 | + | |
947 | 950 | | |
948 | 951 | | |
949 | 952 | | |
| |||
0 commit comments