diff options
author | Cong Wang <amwang@redhat.com> | 2013-01-27 21:14:08 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-29 15:43:03 -0500 |
commit | 604dfd6efc9b79bce432f2394791708d8e8f6efc (patch) | |
tree | 9c3b1021318026f9300d51e6340271946d046b8f /drivers | |
parent | a13d3104710184ecc43edc35a25ae8092058463f (diff) |
pktgen: correctly handle failures when adding a device
The return value of pktgen_add_device() is not checked, so
even if we fail to add some device, for example, non-exist one,
we still see "OK:...". This patch fixes it.
After this patch, I got:
# echo "add_device non-exist" > /proc/net/pktgen/kpktgend_0
-bash: echo: write error: No such device
# cat /proc/net/pktgen/kpktgend_0
Running:
Stopped:
Result: ERROR: can not add device non-exist
# echo "add_device eth0" > /proc/net/pktgen/kpktgend_0
# cat /proc/net/pktgen/kpktgend_0
Running:
Stopped: eth0
Result: OK: add_device=eth0
(Candidate for -stable)
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions