* [PATCH] Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc().
@ 2016-09-18 18:08 Sandhya Bankar
2016-09-18 18:15 ` [Outreachy kernel] " Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-09-18 18:08 UTC (permalink / raw)
To: outreachy-kernel; +Cc: oleg.drokin, andreas.dilger, jsimmons, gregkh
This issue was found by checkpatch.
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/lustre/lustre/llite/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 4965d15..5eed33a 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc().
2016-09-18 18:08 [PATCH] Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc() Sandhya Bankar
@ 2016-09-18 18:15 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-09-18 18:15 UTC (permalink / raw)
To: Sandhya Bankar
Cc: outreachy-kernel, oleg.drokin, andreas.dilger, jsimmons, gregkh
On Sun, 18 Sep 2016, Sandhya Bankar wrote:
> This issue was found by checkpatch.
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/file.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
> index 4965d15..5eed33a 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -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
> if (!*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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> 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.
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-18 18:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-18 18:08 [PATCH] Staging: lustre: Use sizeof structure *pointer over sizeof structure in kzalloc() Sandhya Bankar
2016-09-18 18:15 ` [Outreachy kernel] " Julia Lawall
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.