From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FED0C433E0 for ; Wed, 24 Jun 2020 09:01:20 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D21220857 for ; Wed, 24 Jun 2020 09:01:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D21220857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 154B48744A; Wed, 24 Jun 2020 09:01:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L0IveMtcDPO8; Wed, 24 Jun 2020 09:01:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D0BAE87572; Wed, 24 Jun 2020 09:01:16 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 905AD1BF307 for ; Wed, 24 Jun 2020 09:01:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8838D86BF2 for ; Wed, 24 Jun 2020 09:01:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P6zdiY8b31b1 for ; Wed, 24 Jun 2020 09:01:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sipsolutions.net (s3.sipsolutions.net [144.76.43.62]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 9BC778742C for ; Wed, 24 Jun 2020 09:01:06 +0000 (UTC) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jo1HE-00BFXD-1e; Wed, 24 Jun 2020 11:01:04 +0200 Message-ID: <11b8d5a5631cc472fce17638ff9e1dfef8750628.camel@sipsolutions.net> Subject: Re: [PATCH v7 06/17] wilc1000: add cfg80211.c From: Johannes Berg To: Ajay.Kathat@microchip.com, linux-wireless@vger.kernel.org Date: Wed, 24 Jun 2020 11:00:52 +0200 In-Reply-To: <20200623110000.31559-7-ajay.kathat@microchip.com> References: <20200623110000.31559-1-ajay.kathat@microchip.com> <20200623110000.31559-7-ajay.kathat@microchip.com> User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Venkateswara.Kaja@microchip.com, gregkh@linuxfoundation.org, Nicolas.Ferre@microchip.com, Sripad.Balwadgi@microchip.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Tue, 2020-06-23 at 11:00 +0000, Ajay.Kathat@microchip.com wrote: > > +struct wilc_p2p_pub_act_frame { > + u8 category; > + u8 action; > + u8 oui[3]; > + u8 oui_type; > + u8 oui_subtype; > + u8 dialog_token; > + u8 elem[]; > +} __packed; > + > +struct wilc_vendor_specific_ie { > + u8 tag_number; > + u8 tag_len; > + u8 oui[3]; > + u8 oui_type; > + u8 attr[]; > +} __packed; > + > +struct wilc_attr_entry { > + u8 attr_type; > + __le16 attr_len; > + u8 val[]; > +} __packed; > + > +struct wilc_attr_oper_ch { > + u8 attr_type; > + __le16 attr_len; > + u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; > + u8 op_class; > + u8 op_channel; > +} __packed; > + > +struct wilc_attr_ch_list { > + u8 attr_type; > + __le16 attr_len; > + u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; > + u8 elem[]; > +} __packed; > + > +struct wilc_ch_list_elem { > + u8 op_class; > + u8 no_of_channels; > + u8 ch_list[]; > +} __packed; It seems like these should be used from ieee80211.h, and/or added there if they don't already exist? > +static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info, > + struct key_params *params) > +{ > + kfree(key_info->key); > + > + key_info->key = kmemdup(params->key, params->key_len, GFP_KERNEL); > + if (!key_info->key) > + return -ENOMEM; > + > + kfree(key_info->seq); > + > + if (params->seq_len > 0) { > + key_info->seq = kmemdup(params->seq, params->seq_len, > + GFP_KERNEL); > + if (!key_info->seq) > + return -ENOMEM; you may leak key_info->key here? > +static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u32 len, u8 sta_ch) That's a bit big to be forced inline, imho. if it's used only once the compiler will inline it anyway. > + d = (struct wilc_p2p_pub_act_frame *)(&mgmt->u.action); > + if (d->oui_subtype != GO_NEG_REQ && d->oui_subtype != GO_NEG_RSP && > + d->oui_subtype != P2P_INV_REQ && d->oui_subtype != P2P_INV_RSP) > + goto out_rx_mgmt; > + > + vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_WFA, WLAN_OUI_TYPE_WFA_P2P, > + buff + ie_offset, size - ie_offset); > + if (!vendor_ie) > + goto out_rx_mgmt; > + > + p = (struct wilc_vendor_specific_ie *)vendor_ie; > + wilc_wfi_cfg_parse_ch_attr(p->attr, p->tag_len - 4, vif->wilc->sta_ch); but overall, why do you even need this? I don't think this is normally handled in the driver, but wpa_s? Anyway, I'm not convinced that we should really keep kicking this back over minor issues like this ... better to merge it and fix later, imho. johannes _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel