SERIAL: ioc3_serial: Return -ENOMEM on memory allocation failure
SERIAL: ioc3_serial: Return -ENOMEM on memory allocation failure

In this code, 0 is returned on memory allocation failure, even though other
failures return -ENOMEM or other similar values.

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

// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <b43b0ad1e8108e7ab870d7a54feac93ae8b8600e@diku.dk>
To: Pat Gefre <238379ae80a11fb9b4664e9c5a9703f8bb8eb25b@sgi.com>
Cc: f53ea525f6414247fcc20381d09df7f5c8404aa1@vger.kernel.org
Cc: 6003870694a98d368463a33e52c496f6cda0a6b4@vger.kernel.org
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Cc: 2578944098299abf708b08eff6fcf60565553586@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1704/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas