Thread (24 messages) flat view 24 messages, 7 authors, 2016-01-18

Re: [PATCH 1/3] net-gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection

From: Julia Lawall <hidden>
Date: 2016-01-01 13:05:37
Also in: kernel-janitors, lkml

On Fri, 1 Jan 2016, SF Markus Elfring wrote:
quoted
quoted
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -778,11 +778,13 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow,
 
 	local_rqfpr = kmalloc_array(MAX_FILER_IDX + 1, sizeof(unsigned int),
 				    GFP_KERNEL);
+	if (!local_rqfpr)
+		return 1;
Why return 1?  Previously 0 was returned.
You are right. - Unfortunately, I made a mistake at this place
of my update suggestion.

quoted
Normally, one returns -ENOMEM for this case, but it looks like this 
function is returning 0 on failure.
Should a symbol like "false" be used instead of such a special number?
Maybe it's better than 0 and 1...

julia
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help