mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:02:20 +00:00
net: nfc: remove inappropriate attrs check
Revert "NFC: fix attrs checks in netlink interface" This reverts commit18917d5147
. Our checks found weird attrs present check in function nfc_genl_dep_link_down() and nfc_genl_llc_get_params(), which are introduced by commit18917d5147
("NFC: fix attrs checks in netlink interface"). According to its message, it should add checks for functions nfc_genl_deactivate_target() and nfc_genl_fw_download(). However, it didn't do that. In fact, the expected checks are added by (1) commit385097a367
("nfc: Ensure presence of required attributes in the deactivate_target handler") and (2) commit280e3ebdaf
("nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download()"). Perhaps something went wrong. Anyway, the attr NFC_ATTR_TARGET_INDEX is never accessed in callback nfc_genl_dep_link_down() and same for NFC_ATTR_FIRMWARE_NAME and nfc_genl_llc_get_params(). Thus, remove those checks. Signed-off-by: Lin Ma <linma@zju.edu.cn> Link: https://lore.kernel.org/r/20240410034846.167421-1-linma@zju.edu.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
fbae0fa966
commit
a799de0e59
@ -969,8 +969,7 @@ static int nfc_genl_dep_link_down(struct sk_buff *skb, struct genl_info *info)
|
||||
int rc;
|
||||
u32 idx;
|
||||
|
||||
if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
|
||||
!info->attrs[NFC_ATTR_TARGET_INDEX])
|
||||
if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
|
||||
@ -1018,8 +1017,7 @@ static int nfc_genl_llc_get_params(struct sk_buff *skb, struct genl_info *info)
|
||||
struct sk_buff *msg = NULL;
|
||||
u32 idx;
|
||||
|
||||
if (!info->attrs[NFC_ATTR_DEVICE_INDEX] ||
|
||||
!info->attrs[NFC_ATTR_FIRMWARE_NAME])
|
||||
if (!info->attrs[NFC_ATTR_DEVICE_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]);
|
||||
|
Loading…
Reference in New Issue
Block a user