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]

 



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)"


>  		}
>  
> -		memset(&sinfo, 0, sizeof(sinfo));
> -
> -		sinfo.generation = wil->sinfo_gen++;
> +		sinfo->generation = wil->sinfo_gen++;

Thanks,
 Dedy.





[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