From: Julia Lawall Date: Sun, 19 Aug 2012 07:02:59 +0000 (+0200) Subject: ALSA: sound/ppc/snd_ps3.c: fix error return code X-Git-Tag: v3.6-rc3~14^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c86b93628e5649fd7bb0574b570a51b2b02d586c;p=platform%2Fkernel%2Flinux-3.10.git ALSA: sound/ppc/snd_ps3.c: fix error return code Initialize ret before returning on failure, as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall Signed-off-by: Takashi Iwai --- diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c index 1aa52ef..9b18b52 100644 --- a/sound/ppc/snd_ps3.c +++ b/sound/ppc/snd_ps3.c @@ -1040,6 +1040,7 @@ static int __devinit snd_ps3_driver_probe(struct ps3_system_bus_device *dev) GFP_KERNEL); if (!the_card.null_buffer_start_vaddr) { pr_info("%s: nullbuffer alloc failed\n", __func__); + ret = -ENOMEM; goto clean_preallocate; } pr_debug("%s: null vaddr=%p dma=%#llx\n", __func__,