diff options
| author | Mark Brown <broonie@kernel.org> | 2025-05-20 12:34:09 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-05-20 12:34:09 +0300 |
| commit | 831962e9d7b774d858cfeefc3848e06a2d5599df (patch) | |
| tree | c66522409bd3913a89a7ac3d37459d6bb78ee8b8 /net/mctp/device.c | |
| parent | e4dca67b2463e6abe775876c9cb049ea5b1c8e0d (diff) | |
| parent | 5b5bf5922f4c104e4e829c0dbfdd9399b7cfc434 (diff) | |
| download | linux-831962e9d7b774d858cfeefc3848e06a2d5599df.tar.xz | |
Add sound card support for QCS9100 and QCS9075
Merge series from Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>:
This patchset adds support for sound card on Qualcomm QCS9100 and
QCS9075 boards.
Diffstat (limited to 'net/mctp/device.c')
| -rw-r--r-- | net/mctp/device.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/net/mctp/device.c b/net/mctp/device.c index 8e0724c56723..7c0dcf3df319 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -117,11 +117,18 @@ static int mctp_dump_addrinfo(struct sk_buff *skb, struct netlink_callback *cb) struct net_device *dev; struct ifaddrmsg *hdr; struct mctp_dev *mdev; - int ifindex, rc; - - hdr = nlmsg_data(cb->nlh); - // filter by ifindex if requested - ifindex = hdr->ifa_index; + int ifindex = 0, rc; + + /* Filter by ifindex if a header is provided */ + if (cb->nlh->nlmsg_len >= nlmsg_msg_size(sizeof(*hdr))) { + hdr = nlmsg_data(cb->nlh); + ifindex = hdr->ifa_index; + } else { + if (cb->strict_check) { + NL_SET_ERR_MSG(cb->extack, "mctp: Invalid header for addr dump request"); + return -EINVAL; + } + } rcu_read_lock(); for_each_netdev_dump(net, dev, mcb->ifindex) { |
