* [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported
@ 2022-04-26 12:05 Tom Rix
2022-04-26 12:12 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rix @ 2022-04-26 12:05 UTC (permalink / raw)
To: gregkh, jirislaby, nathan, ndesaulniers; +Cc: linux-kernel, llvm, 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 <trix@redhat.com>
---
drivers/tty/n_gsm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index b0762d2fa8d6..3b8c65f66d64 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -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);
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported
2022-04-26 12:05 [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported Tom Rix
@ 2022-04-26 12:12 ` Greg KH
2022-04-26 18:16 ` Tom Rix
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2022-04-26 12:12 UTC (permalink / raw)
To: Tom Rix; +Cc: jirislaby, nathan, ndesaulniers, linux-kernel, llvm
On Tue, Apr 26, 2022 at 08:05:54AM -0400, Tom Rix wrote:
> 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 <trix@redhat.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported
2022-04-26 12:12 ` Greg KH
@ 2022-04-26 18:16 ` Tom Rix
2022-04-26 18:37 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rix @ 2022-04-26 18:16 UTC (permalink / raw)
To: Greg KH; +Cc: jirislaby, nathan, ndesaulniers, linux-kernel, llvm
On 4/26/22 5:12 AM, Greg KH wrote:
> On Tue, Apr 26, 2022 at 08:05:54AM -0400, Tom Rix wrote:
>> 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 <trix@redhat.com>
> 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.
> Is this the same issue that 0-day reported?
Maybe, it was part of next's update today. Where is 0-day reported ?
Tom
>
> thanks,
>
> greg k-h
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported
2022-04-26 18:16 ` Tom Rix
@ 2022-04-26 18:37 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2022-04-26 18:37 UTC (permalink / raw)
To: Tom Rix; +Cc: jirislaby, nathan, ndesaulniers, linux-kernel, llvm
On Tue, Apr 26, 2022 at 11:16:35AM -0700, Tom Rix wrote:
>
> On 4/26/22 5:12 AM, Greg KH wrote:
> > On Tue, Apr 26, 2022 at 08:05:54AM -0400, Tom Rix wrote:
> > > 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 <trix@redhat.com>
> > 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?
> > 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/202204230704.5MxboEEo-lkp@intel.com
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-26 18:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 12:05 [PATCH] tty: n_gsm: return -EINVAL when adaption is not supported Tom Rix
2022-04-26 12:12 ` Greg KH
2022-04-26 18:16 ` Tom Rix
2022-04-26 18:37 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.