From: Dan Carpenter Date: Tue, 15 May 2012 08:56:59 +0000 (+0300) Subject: drm/radeon: check kmalloc() for failures X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ce0679136678a58cbeca40acd84b6a0462637454;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drm/radeon: check kmalloc() for failures 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 --- 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 {