All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Mingyen Hsieh <mingyen.hsieh@mediatek.com>,
	"nbd@nbd.name" <nbd@nbd.name>,
	"lorenzo@kernel.org" <lorenzo@kernel.org>
Cc: "deren.wu@mediatek.com" <deren.wu@mediatek.com>,
	"Sean.Wang@mediatek.com" <Sean.Wang@mediatek.com>,
	"Soul.Huang@mediatek.com" <Soul.Huang@mediatek.com>,
	"Leon.Yen@mediatek.com" <Leon.Yen@mediatek.com>,
	"Michael.Lo@mediatek.com" <Michael.Lo@mediatek.com>,
	"Eric-SY.Chang@mediatek.com" <Eric-SY.Chang@mediatek.com>,
	"km.lin@mediatek.com" <km.lin@mediatek.com>,
	"robin.chiu@mediatek.com" <robin.chiu@mediatek.com>,
	"ch.yeh@mediatek.com" <ch.yeh@mediatek.com>,
	"posh.sun@mediatek.com" <posh.sun@mediatek.com>,
	"Quan.Zhou@mediatek.com" <Quan.Zhou@mediatek.com>,
	"Ryder.Lee@mediatek.com" <Ryder.Lee@mediatek.com>,
	"Shayne.Chen@mediatek.com" <Shayne.Chen@mediatek.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: RE: [PATCH] wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer
Date: Mon, 4 Nov 2024 00:36:44 +0000	[thread overview]
Message-ID: <db0ce439afcf434abafeaf03de31ddee@realtek.com> (raw)
In-Reply-To: <20241101081249.27834-1-mingyen.hsieh@mediatek.com>

Mingyen Hsieh <mingyen.hsieh@mediatek.com> wrote:
> 
> Use tlv instead of skb, because using skb will get invalid data
> with wrong offset.
> 
> Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> index 0c2a2337c313..9b6aff463063 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> @@ -823,7 +823,7 @@ mt7925_mcu_get_nic_capability(struct mt792x_dev *dev)
>                         mt7925_mcu_parse_phy_cap(dev, tlv->data);
>                         break;
>                 case MT_NIC_CAP_CHIP_CAP:
> -                       memcpy(&dev->phy.chip_cap, (void *)skb->data, sizeof(u64));
> +                       memcpy(&dev->phy.chip_cap, (void *)tlv->data, sizeof(u64));

chip_cap is u64 in CPU order, and tlv->data coming from firmware should be 
little-endian order. So using le64_to_cpu() might be more suitable: 

dev->phy.chip_cap = le64_to_cpu((__le64 *)tlv->data);


>                         break;
>                 case MT_NIC_CAP_EML_CAP:
>                         mt7925_mcu_parse_eml_cap(dev, tlv->data);
> --
> 2.45.2
> 


      reply	other threads:[~2024-11-04  0:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01  8:12 [PATCH] wifi: mt76: mt7925: fix get wrong chip cap from incorrect pointer Mingyen Hsieh
2024-11-04  0:36 ` Ping-Ke Shih [this message]

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=db0ce439afcf434abafeaf03de31ddee@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Michael.Lo@mediatek.com \
    --cc=Quan.Zhou@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=Sean.Wang@mediatek.com \
    --cc=Shayne.Chen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=deren.wu@mediatek.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=mingyen.hsieh@mediatek.com \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.