From ce0679136678a58cbeca40acd84b6a0462637454 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 15 May 2012 11:56:59 +0300 Subject: drm/radeon: check kmalloc() for failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can just return -ENOMEM here if the allocation fails. Signed-off-by: Dan Carpenter Reviewed-by: Michel Dänzer Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/r100.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 0874a6dd411f..fb44e7e49083 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -2008,6 +2008,8 @@ int r100_cs_parse(struct radeon_cs_parser *p) int r; track = kzalloc(sizeof(*track), GFP_KERNEL); + if (!track) + return -ENOMEM; r100_cs_track_clear(p->rdev, track); p->track = track; do { -- cgit v1.2.1