Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc().
PATCH 1/1 Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc().
This issue was found by checkpatch.
--- drivers/staging/lustre/lustre/llite/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +1 -1
@@ -657,7 +657,7 @@ restart: goto restart; } - *och_p =kzalloc (sizeof (struct obd_client_handle ),GFP_NOFS ); + *och_p =kzalloc (sizeof (*och_p),GFP_NOFS );if (!*och_p) { rc = -ENOMEM ; goto out_och_free;
Signature · 1 line
1.7.1
Quoted 12 lines · Sandhya Bankar
This issue was found by checkpatch.
Signed-off-by Sandhya Bankar <[email protected]>--- drivers/staging/lustre/lustre/llite/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/staging/lustre/lustre/llite/file.c +0
-0
drivers/staging/lustre/lustre/llite/file.c restart: · line 660
Quoted 5 lines
drivers/staging/lustre/lustre/llite/file.c +1
-1@@ -657,7 +657,7 @@ restart: goto restart; } - *och_p =kzalloc (sizeof (struct obd_client_handle ),GFP_NOFS ); + *och_p =kzalloc (sizeof (*och_p),GFP_NOFS );
This doesn't look right. The declaration of och_p is:
struct obd_client_handle **och_p = NULL;
So sizeof(*och_p) is just the size of a pointer.
julia
Quoted 13 lines
drivers/staging/lustre/lustre/llite/file.c +0
-1if (!*och_p) { rc = -ENOMEM ; goto out_och_free; --1.7.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160918180816.GA4562%40sandhya.
For more options, visit https://groups.google.com/d/optout.