On Wed, Feb 19, 2014 at 11:37 AM, Yogesh Ashok Powar <yogeshp@xxxxxxxxxxx> wrote: > Adding AP firmware command to access BBP > regs. This will be used for retrieving > different counters CCA/RX needed for ACS > > Signed-off-by: Yogesh Ashok Powar <yogeshp@xxxxxxxxxxx> > Signed-off-by: Nishant Sarmukadam <nishants@xxxxxxxxxxx> > --- > drivers/net/wireless/mwl8k.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c > index 4987c3f..159125e 100644 > --- a/drivers/net/wireless/mwl8k.c > +++ b/drivers/net/wireless/mwl8k.c > @@ -2987,6 +2988,45 @@ static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw) > } > > /* > + * CMD_BBP_REG_ACCESS. > + */ > +struct mwl8k_cmd_bbp_reg_access { > + struct mwl8k_cmd_pkt header; > + __le16 action; > + __le16 offset; > + u8 value; > + u8 rsrv[3]; > +} __packed; > + > +static int > +mwl8k_cmd_bbp_reg_access(struct ieee80211_hw *hw, > + u16 action, > + u16 offset, > + u8 *value) > +{ > + struct mwl8k_cmd_bbp_reg_access *cmd; > + int rc; > + > + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); > + if (cmd == NULL) > + return -ENOMEM; > + > + cmd->header.code = cpu_to_le16(MWL8K_CMD_BBP_REG_ACCESS); > + cmd->header.length = cpu_to_le16(sizeof(*cmd)); > + cmd->action = cpu_to_le16(action); > + cmd->offset = cpu_to_le16(offset); > + > + rc = mwl8k_post_cmd(hw, &cmd->header); > + > + if (!rc) > + *value = cmd->value; > + else > + *value = 0; > + > + return rc; You don't free the allocated cmd anywhere, so you are leaking memory on every call. Regards Jonas -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html