From: Greg KH <gregkh@linuxfoundation.org>
To: Rujra Bhatt <braker.noob.kernel@gmail.com>
Cc: dpenkler@gmail.com, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, outreachy@lists.linux.dev
Subject: Re: [FIRST-PATCH] staging : gpib : agilent_82350b : agilent_82350b.c : fixes checks on the file
Date: Thu, 17 Apr 2025 11:01:48 +0200 [thread overview]
Message-ID: <2025041717-hastily-pyramid-fa10@gregkh> (raw)
In-Reply-To: <Z_-nR5Vt2A5kvbro@brak3rDesk>
On Wed, Apr 16, 2025 at 06:19:11PM +0530, Rujra Bhatt wrote:
> It has recommended to
> Prefer kzalloc(sizeof(*board->private_data)...)
> over kzalloc(sizeof(struct agilent_82350b_priv)...)
>
> Signed-off-by: Rujra Bhatt <braker.noob.kernel@gmail.com>
> ---
> drivers/staging/gpib/agilent_82350b/agilent_82350b.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
> index 445b9380ff98..956e21886eb6 100644
> --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
> +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
> @@ -479,7 +479,7 @@ static void agilent_82350b_return_to_local(struct gpib_board *board)
>
> static int agilent_82350b_allocate_private(struct gpib_board *board)
> {
> - board->private_data = kzalloc(sizeof(struct agilent_82350b_priv), GFP_KERNEL);
> + board->private_data = kzalloc(sizeof(struct * board->private_data), GFP_KERNEL);
> if (!board->private_data)
> return -ENOMEM;
> return 0;
> --
> 2.43.0
>
>
Is there a reason you did not even build your patch before submitting
it?
Please take some time to learn the C language first before working on
the kernel.
good luck!
greg k-hh
next prev parent reply other threads:[~2025-04-17 9:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-16 12:49 [FIRST-PATCH] staging : gpib : agilent_82350b : agilent_82350b.c : fixes checks on the file Rujra Bhatt
2025-04-16 14:12 ` Dave Penkler
2025-04-17 9:01 ` Greg KH [this message]
2025-05-07 7:58 ` kernel test robot
2025-05-07 12:19 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025041717-hastily-pyramid-fa10@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=braker.noob.kernel@gmail.com \
--cc=dpenkler@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.