]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: fix error returning in ena_com_get_hash_function()
authorArthur Kiyanovski <akiyano@amazon.com>
Sun, 3 May 2020 09:52:11 +0000 (09:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 May 2020 22:59:29 +0000 (15:59 -0700)
commitdf0e56757a422306e0473a231bde8dd53c42879b
treefd084647f0b627ac9a691c15abae0eb0bfaeee4d
parent1440b397c0e58df85d381467913fab59aefac779
net: ena: fix error returning in ena_com_get_hash_function()

In case the "func" parameter is NULL we now return "-EINVAL".
This shouldn't happen in general, but when it does happen, this is the
proper way to handle it.

We also check func for NULL in the beginning of the function, as there
is no reason to do all the work and realize in the end of the function
it was useless.

Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_com.c