staging: slicoss: fix a null deref when pci_alloc_consistent fail
we are dereferencing the pshmem , and the pci_alloc_consistent can fail returning null, do a memcpy if we have a valid pshmem Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8f6f4c17bb
commit
b8131fc0e1
1 changed files with 2 additions and 3 deletions
|
@ -3701,9 +3701,8 @@ static void slic_init_adapter(struct net_device *netdev,
|
||||||
phys_shmem);
|
phys_shmem);
|
||||||
ASSERT(adapter->pshmem);
|
ASSERT(adapter->pshmem);
|
||||||
|
|
||||||
|
if (adapter->pshmem)
|
||||||
memset(adapter->pshmem, 0, sizeof(struct slic_shmem));
|
memset(adapter->pshmem, 0, sizeof(struct slic_shmem));
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct net_device_ops slic_netdev_ops = {
|
static const struct net_device_ops slic_netdev_ops = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue