[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94b3634f-f531-d4f1-2809-dc4de5b9b876@gmail.com>
Date: Sun, 5 Sep 2021 23:40:37 +0200
From: Michael Straube <straube.linux@...il.com>
To: Pavel Skripkin <paskripkin@...il.com>, Larry.Finger@...inger.net,
phil@...lpotter.co.uk, gregkh@...uxfoundation.org,
fmdefrancesco@...il.com
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: r8188eu: fix type mismacth
Hi Pavel,
On 9/5/21 22:52, Pavel Skripkin wrote:
> diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
> index fee4208dacba..afe6c7fa594d 100644
> --- a/drivers/staging/r8188eu/core/rtw_cmd.c
> +++ b/drivers/staging/r8188eu/core/rtw_cmd.c
> @@ -1162,7 +1162,7 @@ u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr)
> goto exit;
> }
>
> - psetassocsta_rsp = kzalloc(sizeof(struct set_assocsta_rsp), GFP_ATOMIC);
> + psetassocsta_rsp = kzalloc(sizeof(struct set_stakey_rsp), GFP_ATOMIC);
this should be
psetassocsta_rsp = kzalloc(sizeof(*psetassocsta_rsp), GFP_ATOMIC);
This way you get always the correct size, no matter what's the type of
psetassocsta_rsp. Checkpatch suggests this too. ;)
Best regards,
Michael
Powered by blists - more mailing lists