Skip to content
Commit 514dd88d authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman
Browse files

staging: slicoss: Add error check for pci_map_single



Currently, DMA mapping failure is not detected, causing the hardware
to attempt a DMA from an invalid address.

This patch adds the corresponding error check for pci_map_single i.e.
pci_dma_mapping_error.

Problem found using the following Coccinelle semantic patch:
// <smpl>
@@
expression e1;
identifier x;
@@
 x=
(
*dma_map_single(...)
|
*dma_map_page(...)
)
... when != dma_mapping_error(e1,x)
@@
expression e1;
identifier x;
@@

 x =
(
*pci_map_single(...)
|
*pci_map_page(...)
)
 ... when != pci_dma_mapping_error(e1,x)
// </smpl>

Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent afb10554
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment