ethtool: eeprom: fix null-deref on genl_info in dump

commit 9d9effca9d upstream.

The similar fix as commit 46cdedf2a0 ("ethtool: pse-pd: fix null-deref on
genl_info in dump") is also needed for ethtool eeprom.

Fixes: c781ff12a2 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Xin Long 2022-10-21 10:22:47 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель 1c2b1d3bba
Коммит 138a13d8f5
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;