tty: n_gsm: return -EINVAL when adaption is not supported
PATCH 1/1 tty: n_gsm: return -EINVAL when adaption is not supported
The clang build fails with
n_gsm.c:940:13: error: variable 'size' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
} else if (dlci->adaption == 2) {
^~~~~~~~~~~~~~~~~~~The else should return an error, so return -EINVAL.
--- drivers/tty/n_gsm.c | 1 + 1 file changed, 1 insertion(+)
drivers/tty/n_gsm.c +1 -0
@@ -944,6 +944,7 @@ static int gsm_dlci_modem_output(struct gsm_mux *gsm, struct gsm_dlci *dlci, }else {pr_err ("%s: unsupported adaption %d\n" , __func__, dlci->adaption); +return -EINVAL ; } msg =gsm_data_alloc (gsm, dlci->addr, size, gsm->ftype);
Signature · 1 line
2.27.0
Greg KH
maintainerQuoted 8 lines · Tom Rix
The clang build fails with
n_gsm.c:940:13: error: variable 'size' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]} else if (dlci->adaption == 2) { ^~~~~~~~~~~~~~~~~~~The else should return an error, so return
-EINVAL.Signed-off-by Tom Rix <[email protected]>
What commit id does this fix? Any reason you didn't cc: the author of the recent changes to this code?
Is this the same issue that 0-day reported?
thanks,
greg k-h
Quoted 11 lines · Greg KH
Quoted 8 lines · Tom Rix
The clang build fails with
n_gsm.c:940:13: error: variable 'size' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]} else if (dlci->adaption == 2) { ^~~~~~~~~~~~~~~~~~~The else should return an error, so return
-EINVAL.Signed-off-by Tom Rix <[email protected]>What commit id does this fix? Any reason you didn't cc: the author of the recent changes to this code?
Sorry missed this part.
Quoted 1 line
Is this the same issue that 0-day reported?
Maybe, it was part of next's update today. Where is 0-day reported ?
Tom
Quoted 5 lines
thanks,
greg k-h
Greg KH
maintainerQuoted 8 lines · Tom Rix
Quoted 6 lines · Greg KH
Quoted 5 lines · Tom Rix
The clang build fails with
n_gsm.c:940:13: error: variable 'size' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]} else if (dlci->adaption == 2) { ^~~~~~~~~~~~~~~~~~~
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
The else should return an error, so return
-EINVAL.Signed-off-by Tom Rix <[email protected]>What commit id does this fix? Any reason you didn't cc: the author of the recent changes to this code?
Sorry missed this part.
Please always do that, otherwise it's hard to track, right?
Quoted 3 lines
Quoted 1 line
Is this the same issue that 0-day reported?
Maybe, it was part of next's update today. Where is 0-day reported ?
On the same mailing list you posted this patch to:
https://lore.kernel.org/r/[email protected]
thanks,
greg k-h