lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025041717-hastily-pyramid-fa10@gregkh>
Date: Thu, 17 Apr 2025 11:01:48 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Rujra Bhatt <braker.noob.kernel@...il.com>
Cc: dpenkler@...il.com, linux-staging@...ts.linux.dev,
	linux-kernel@...r.kernel.org, outreachy@...ts.linux.dev
Subject: Re: [FIRST-PATCH] staging : gpib : agilent_82350b : agilent_82350b.c
 : fixes checks on the file

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ