Skip to content

Commit

Permalink
ethtool: eeprom: fix null-deref on genl_info in dump
Browse files Browse the repository at this point in the history
The similar fix as commit 46cdedf ("ethtool: pse-pd: fix null-deref on
genl_info in dump") is also needed for ethtool eeprom.

Fixes: c781ff1 ("ethtool: Allow network drivers to dump arbitrary EEPROM data")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/5575919a2efc74cd9ad64021880afc3805c54166.1666362167.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Xin Long authored and Jakub Kicinski committed Oct 25, 2022
1 parent 337a0a0 commit 9d9effc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ethtool/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static int eeprom_prepare_data(const struct ethnl_req_info *req_base,
if (ret)
goto err_free;

ret = get_module_eeprom_by_page(dev, &page_data, info->extack);
ret = get_module_eeprom_by_page(dev, &page_data, info ? info->extack : NULL);
if (ret < 0)
goto err_ops;

Expand Down

0 comments on commit 9d9effc

Please sign in to comment.