Commit 49ea1480 authored by Helge Deller's avatar Helge Deller

parisc: Add break statements to pdc_pat_io_pci_cfg_read()

Dan Carpenter noticed that pdc_pat_io_pci_cfg_read() is problematic
because it's missing some break statements so it copies 4 bytes
regardless of whether you asked for only 1 or 2.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 773e1c5f
...@@ -1354,9 +1354,9 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr) ...@@ -1354,9 +1354,9 @@ int pdc_pat_io_pci_cfg_read(unsigned long pci_addr, int pci_size, u32 *mem_addr)
retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ, retval = mem_pdc_call(PDC_PAT_IO, PDC_PAT_IO_PCI_CONFIG_READ,
__pa(pdc_result), pci_addr, pci_size); __pa(pdc_result), pci_addr, pci_size);
switch(pci_size) { switch(pci_size) {
case 1: *(u8 *) mem_addr = (u8) pdc_result[0]; case 1: *(u8 *) mem_addr = (u8) pdc_result[0]; break;
case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; break;
case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; break;
} }
spin_unlock_irqrestore(&pdc_lock, flags); spin_unlock_irqrestore(&pdc_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment