From 7ed25867478fb8d2118eb84b99c1bf21e4ae695c Mon Sep 17 00:00:00 2001 From: Wang YanQing Date: Mon, 13 Aug 2012 18:02:32 +0800 Subject: video:uvesafb: check the return value of kzalloc Michal maybe forgot it merely, we should add code to check the return value of kzalloc to make the code more robust. Signed-off-by: Wang YanQing Signed-off-by: Florian Tobias Schandinat --- drivers/video/uvesafb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/video/uvesafb.c') diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index b0e2a4261afe..2f8f82d874a1 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -659,6 +659,8 @@ static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task, task->t.flags = TF_BUF_RET | TF_BUF_ESDI; task->t.buf_len = EDID_LENGTH; task->buf = kzalloc(EDID_LENGTH, GFP_KERNEL); + if (!task->buf) + return -ENOMEM; err = uvesafb_exec(task); -- cgit v1.2.3