From: "Dedy Lansky" <dlansky@codeaurora.org>
To: "'Toke Høiland-Jørgensen'" <toke@toke.dk>,
linux-wireless@vger.kernel.org
Subject: RE: [PATCH v4] wireless-drivers: Dynamically allocate struct station_info
Date: Thu, 10 May 2018 12:58:17 +0300 [thread overview]
Message-ID: <000901d3e845$6d7fdd00$487f9700$@codeaurora.org> (raw)
In-Reply-To: <152594435934.24751.8979312538330792032.stgit@alrua-kau>
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 =3D vif_to_wdev(vif);
> struct wmi_connect_event *evt =3D 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 =3D NULL;
> } else if ((wdev->iftype =3D=3D NL80211_IFTYPE_AP) ||
> (wdev->iftype =3D=3D NL80211_IFTYPE_P2P_GO)) {
> +
> + sinfo =3D kzalloc(sizeof(*sinfo), GFP_KERNEL);
> + if (!sinfo)
> + rc =3D -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)"
> }
> =20
> - memset(&sinfo, 0, sizeof(sinfo));
> -
> - sinfo.generation =3D wil->sinfo_gen++;
> + sinfo->generation =3D wil->sinfo_gen++;
Thanks,
Dedy.
next prev parent reply other threads:[~2018-05-10 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 9:27 [PATCH v4] wireless-drivers: Dynamically allocate struct station_info Toke Høiland-Jørgensen
2018-05-10 9:51 ` Sergey Matyukevich
2018-05-10 9:58 ` Dedy Lansky [this message]
2018-05-10 10:24 ` Toke Høiland-Jørgensen
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='000901d3e845$6d7fdd00$487f9700$@codeaurora.org' \
--to=dlansky@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=toke@toke.dk \
/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