* [PATCH 1/1] TTY Fix NULL pointer error in tty_wakeup @ 2013-03-30 7:58 Frankie Lin 2013-03-30 15:18 ` Greg Kroah-Hartman 0 siblings, 1 reply; 3+ messages in thread From: Frankie Lin @ 2013-03-30 7:58 UTC (permalink / raw) To: Greg Kroah-Hartman, Jiri Slaby; +Cc: open, Frankie Lin When calling tty_wakeup and the parameter is NULL,the oops will happen. The virtual address &tty->flags can not be handled in the kernel space, while PC goto test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags). Tested on ARM Machine msm8625. Signed-off-by: Frankie Lin <frankiefrankie.lin@gmail.com> --- drivers/tty/tty_io.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 05400ac..9c4fb2e 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -519,6 +519,11 @@ void tty_wakeup(struct tty_struct *tty) { struct tty_ldisc *ld; + if (!tty) { + pr_err("tty is null in function: %s.\n", __func__); + return; + } + if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) { ld = tty_ldisc_ref(tty); if (ld) { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] TTY Fix NULL pointer error in tty_wakeup 2013-03-30 7:58 [PATCH 1/1] TTY Fix NULL pointer error in tty_wakeup Frankie Lin @ 2013-03-30 15:18 ` Greg Kroah-Hartman [not found] ` <CAD-pLEFtw0=j+jL2+ecqKShdz_GOSmfAzn3T0+3mr=5Ofnks7w@mail.gmail.com> 0 siblings, 1 reply; 3+ messages in thread From: Greg Kroah-Hartman @ 2013-03-30 15:18 UTC (permalink / raw) To: Frankie Lin; +Cc: Jiri Slaby, open On Sat, Mar 30, 2013 at 03:58:43PM +0800, Frankie Lin wrote: > When calling tty_wakeup and the parameter is NULL,the oops will happen. Who is calling that function with NULL? Shouldn't that be fixed instead? thanks, greg k-h ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <CAD-pLEFtw0=j+jL2+ecqKShdz_GOSmfAzn3T0+3mr=5Ofnks7w@mail.gmail.com>]
* Re: [PATCH 1/1] TTY Fix NULL pointer error in tty_wakeup [not found] ` <CAD-pLEFtw0=j+jL2+ecqKShdz_GOSmfAzn3T0+3mr=5Ofnks7w@mail.gmail.com> @ 2013-03-31 15:02 ` Greg Kroah-Hartman 0 siblings, 0 replies; 3+ messages in thread From: Greg Kroah-Hartman @ 2013-03-31 15:02 UTC (permalink / raw) To: frankie lin; +Cc: Jiri Slaby, open A: No. Q: Should I include quotations after my reply? http://daringfireball.net/2007/07/on_top On Sun, Mar 31, 2013 at 04:09:05PM +0800, frankie lin wrote: > Hi, greg, it's excited to get your reply. > In our case, it is gs_start_io(struct gs_port *port) in the file u_serial.c who > call the tty_wakeup. We are trying to find the root cause. Something is wrong > before calling tty_wakeup, nevertheless it is reasonable to check the parameter > first before test_bit. No, please find the root problem here in your driver. > To some extent, this patch can improve the robustness of function tty_wakeup, > isn't it? Not at the expense of papering over other bugs, sorry. greg k-h ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-31 15:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30 7:58 [PATCH 1/1] TTY Fix NULL pointer error in tty_wakeup Frankie Lin
2013-03-30 15:18 ` Greg Kroah-Hartman
[not found] ` <CAD-pLEFtw0=j+jL2+ecqKShdz_GOSmfAzn3T0+3mr=5Ofnks7w@mail.gmail.com>
2013-03-31 15:02 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox