]> git.baikalelectronics.ru Git - kernel.git/commit
ethoc: fix null dereference in ethoc_probe
authorThomas Chou <thomas@wytron.com.tw>
Sun, 23 May 2010 16:44:02 +0000 (16:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2010 06:11:09 +0000 (23:11 -0700)
commit0cdc74b074ea1997c38cba6894a20ca2558e07c8
tree26a6accadf8b370425b7c7c5e15351375a1fbf10
parent4931862c36a270da02c598fc7d8f0c8ac6c3de8b
ethoc: fix null dereference in ethoc_probe

Dan reported the patch 2074b6a7f73: "ethoc: use system memory
as buffer" introduced a potential null dereference.

  1060  free:
  1061          if (priv->dma_alloc)
                    ^^^^^^^^^^^^^^^
priv can be null here.

He also suggested that the error handling is not complete.

This patch fixes the null priv issue and improves resources
releasing in ethoc_probe() and ethoc_remove().

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethoc.c