mirror of https://gitee.com/openkylin/linux.git
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
773e1c5fa4
commit
49ea1480f4
|
@ -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,
|
||||
__pa(pdc_result), pci_addr, pci_size);
|
||||
switch(pci_size) {
|
||||
case 1: *(u8 *) mem_addr = (u8) pdc_result[0];
|
||||
case 2: *(u16 *)mem_addr = (u16) pdc_result[0];
|
||||
case 4: *(u32 *)mem_addr = (u32) pdc_result[0];
|
||||
case 1: *(u8 *) mem_addr = (u8) pdc_result[0]; break;
|
||||
case 2: *(u16 *)mem_addr = (u16) pdc_result[0]; break;
|
||||
case 4: *(u32 *)mem_addr = (u32) pdc_result[0]; break;
|
||||
}
|
||||
spin_unlock_irqrestore(&pdc_lock, flags);
|
||||
|
||||
|
|
Loading…
Reference in New Issue