Search Linux Wireless

RE: [PATCH v4] wireless-drivers: Dynamically allocate struct station_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10 May 2018 11:58:17 CEST, Dedy Lansky <dlansky@xxxxxxxxxxxxxx> wrote:
>Hi Toke,
>
>Thanks for taking care of wil6210 part. See comment below.
>
>> @@ -824,7 +824,7 @@ static void wmi_evt_connect(struct wil6210_vif
>*vif, int id, void *d, int len)
>>  	struct wireless_dev *wdev = vif_to_wdev(vif);
>>  	struct wmi_connect_event *evt = d;
>>  	int ch; /* channel number */
>> -	struct station_info sinfo;
>> +	struct station_info *sinfo;
>>  	u8 *assoc_req_ie, *assoc_resp_ie;
>>  	size_t assoc_req_ielen, assoc_resp_ielen;
>>  	/* capinfo(u16) + listen_interval(u16) + IEs */ @@ -940,6 +940,11
>@@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void
>*d, int len)
>>  		vif->bss = NULL;
>>  	} else if ((wdev->iftype == NL80211_IFTYPE_AP) ||
>>  		   (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
>> +
>> +		sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
>> +		if (!sinfo)
>> +			rc = -ENOMEM;
>> +
>>  		if (rc) {
>>  			if (disable_ap_sme)
>>  				/* notify new_sta has failed */
>> @@ -947,16 +952,16 @@ static void wmi_evt_connect(struct wil6210_vif
>*vif, int id, void *d, int len)
>>  			goto out;
>
>Need to kfree sinfo here. I suggest instead to move the kzalloc below
>the whole "if (rc)"

Ah, right. And here I thought I was being clever by reusing the rc check.

Note to self: don't try to be clever.

Will fix, thanks :)

-Toke




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux