public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Skripkin <paskripkin@gmail.com>
To: Michael Straube <straube.linux@gmail.com>, gregkh@linuxfoundation.org
Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
Date: Sun, 5 Dec 2021 20:23:14 +0300	[thread overview]
Message-ID: <51a14a4a-8385-b155-a16f-b4cc8b0096c7@gmail.com> (raw)
In-Reply-To: <b3886219-9a24-c119-fe10-12e5e7c6b139@gmail.com>

On 12/5/21 18:22, Michael Straube wrote:
>> Not related to your patch, but not returning an error from this function 
>>   looks very dangerous to me.
>> 
>> adapt->HalData is used in GET_HAL_DATA() macro all across the driver 
>> code and nobody checks if it valid or not. If allocation fails here, 
>> than we will likely hit GPF while accessing hal_data fields.
>> 
>> Maybe we can embed struct hal_data_8188e instead of storing a pointer to 
>> it?
> 
> Rethinking my prevoius answer, embedding struct hal_data_8188e is the
> better solution I think.
> 

I also think so. At least, it looks like this is very core structure and 
embedding it into struct adapter sounds more reasonable.

Also, it is one step further to make struct adapter more consistent. For 
now it looks confusing: some of privs are pointers and others are not:

struct adapter {
...
	struct dvobj_priv *dvobj;
	struct	mlme_priv mlmepriv;
	struct	mlme_ext_priv mlmeextpriv;
	struct	cmd_priv	cmdpriv;
	struct	evt_priv	evtpriv;
	struct	io_priv	iopriv;
	struct	xmit_priv	xmitpriv;
	struct	recv_priv	recvpriv;
	struct	sta_priv	stapriv;
	struct	security_priv	securitypriv;
	struct	registry_priv	registrypriv;
	struct	pwrctrl_priv	pwrctrlpriv;
	struct	eeprom_priv eeprompriv;
	struct	led_priv	ledpriv;
	struct	hostapd_priv	*phostapdpriv;
	struct wifidirect_info	wdinfo;

	void *HalData;

...

and even why Haldata is void *, but not struct hal_data_8188e * :)


so many questions and so few answers....



With regards,
Pavel Skripkin

  reply	other threads:[~2021-12-05 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05 13:59 [PATCH 00/12] staging: r8188eu: misc cleanups Michael Straube
2021-12-05 13:59 ` [PATCH 01/12] staging: r8188eu: remove RF_PATH_{C,D} Michael Straube
2021-12-05 13:59 ` [PATCH 02/12] staging: r8188eu: struct odm_mac_status_info is not used Michael Straube
2021-12-05 13:59 ` [PATCH 03/12] staging: r8188eu: remove macro PHY_SetRFReg Michael Straube
2021-12-05 13:59 ` [PATCH 04/12] staging: r8188eu: remove macro PHY_QueryRFReg Michael Straube
2021-12-05 13:59 ` [PATCH 05/12] staging: r8188eu: remove macro PHY_SetBBReg Michael Straube
2021-12-05 13:59 ` [PATCH 06/12] staging: r8188eu: remove macro PHY_QueryBBReg Michael Straube
2021-12-05 13:59 ` [PATCH 07/12] staging: r8188eu: remove duplicate defines Michael Straube
2021-12-05 13:59 ` [PATCH 08/12] staging: r8188eu: bWIFI_Direct is set but never used Michael Straube
2021-12-05 13:59 ` [PATCH 09/12] staging: r8188eu: bWIFI_Display " Michael Straube
2021-12-05 13:59 ` [PATCH 10/12] staging: r8188eu: remove unused macro IS_FW_81xxC Michael Straube
2021-12-05 13:59 ` [PATCH 11/12] staging: r8188eu: remove macro GET_HAL_DATA Michael Straube
2021-12-05 13:59 ` [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used Michael Straube
2021-12-05 14:42   ` Pavel Skripkin
2021-12-05 15:14     ` Michael Straube
2021-12-05 15:22     ` Michael Straube
2021-12-05 17:23       ` Pavel Skripkin [this message]
2021-12-05 18:09         ` Michael Straube

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=51a14a4a-8385-b155-a16f-b4cc8b0096c7@gmail.com \
    --to=paskripkin@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox