Re: [PATCH v4] vt: fix a missing-check bug in con_init()

2019-06-12 Thread Nicolas Pitre
On Wed, 12 Jun 2019, Gen Zhang wrote: > On Wed, Jun 12, 2019 at 03:38:38PM +0200, Greg KH wrote: > > On Wed, Jun 12, 2019 at 09:15:06PM +0800, Gen Zhang wrote: > > > In function con_init(), the pointer variable vc_cons[currcons].d, vc and > > > vc->vc_screenbuf is allocated by kzalloc(). However,

Re: [PATCH v4] vt: fix a missing-check bug in con_init()

2019-06-12 Thread Greg KH
On Wed, Jun 12, 2019 at 09:44:49PM +0800, Gen Zhang wrote: > On Wed, Jun 12, 2019 at 03:38:38PM +0200, Greg KH wrote: > > On Wed, Jun 12, 2019 at 09:15:06PM +0800, Gen Zhang wrote: > > > In function con_init(), the pointer variable vc_cons[currcons].d, vc and > > > vc->vc_screenbuf is allocated by

Re: [PATCH v4] vt: fix a missing-check bug in con_init()

2019-06-12 Thread Gen Zhang
On Wed, Jun 12, 2019 at 03:38:38PM +0200, Greg KH wrote: > On Wed, Jun 12, 2019 at 09:15:06PM +0800, Gen Zhang wrote: > > In function con_init(), the pointer variable vc_cons[currcons].d, vc and > > vc->vc_screenbuf is allocated by kzalloc(). However, kzalloc() returns > > NULL when fails. Theref

Re: [PATCH v4] vt: fix a missing-check bug in con_init()

2019-06-12 Thread Greg KH
On Wed, Jun 12, 2019 at 09:15:06PM +0800, Gen Zhang wrote: > In function con_init(), the pointer variable vc_cons[currcons].d, vc and > vc->vc_screenbuf is allocated by kzalloc(). However, kzalloc() returns > NULL when fails. Therefore, we should check the return value and handle > the error. >

[PATCH v4] vt: fix a missing-check bug in con_init()

2019-06-12 Thread Gen Zhang
In function con_init(), the pointer variable vc_cons[currcons].d, vc and vc->vc_screenbuf is allocated by kzalloc(). However, kzalloc() returns NULL when fails. Therefore, we should check the return value and handle the error. Signed-off-by: Gen Zhang --- diff --git a/drivers/tty/vt/vt.c b/dri