Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HSI: cmt_speech: fix error return code

Return a negative error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Julia Lawall and committed by
Sebastian Reichel
265ef3ee f9c0d76e

+1
+1
drivers/hsi/clients/cmt_speech.c
··· 1028 1028 } 1029 1029 hsi_if->master = ssip_slave_get_master(cl); 1030 1030 if (IS_ERR(hsi_if->master)) { 1031 + err = PTR_ERR(hsi_if->master); 1031 1032 dev_err(&cl->device, "Could not get HSI master client\n"); 1032 1033 goto leave4; 1033 1034 }