Skip to contentSkip to conversation

arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefencing

PATCH In review Fengguang Wu 3 participants 3 messages Sep 9, 2012 – Sep 13, 2012 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 73/77 arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefencing

Hi Matthew,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
head:   97ac9d1f363964dec7fbb20cf3c2e88336b4d801
commit: 66f2adcdadea18a583d4f7cbd773847d635731a3 [73/77] EFI: Stash ROMs if they're not in the PCI BAR

All smatch warnings:

+ arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefencing uninitialized 'pci_handle'.
+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: add some parenthesis here?
+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: maybe use && instead of & arch/x86/boot/compressed/eboot.c:728 handle_ramdisks() error: potentially derefencing uninitialized 'fh'.

---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <[email protected]> Intel Corporation

#1 lore raw

Re: [pci:next 73/77] arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefen

Quoted 11 lines · Fengguang Wu

Hi Matthew,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
head:   97ac9d1f363964dec7fbb20cf3c2e88336b4d801
commit: 66f2adcdadea18a583d4f7cbd773847d635731a3 [73/77] EFI: Stash ROMs if they're not in the PCI BAR

All smatch warnings:

+ arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefencing uninitialized 'pci_handle'.

These warnings probably have too high of a false positive rate to be worth emailing about. Although this one looks like a real bug. We should be passing "&pci_handle" to efi_call_phys5 instead of "pci_handle".

I'm not sure why GCC doesn't warn about these. Anyway, it's because GCC didn't warn about unitialized variables that I added it to Smatch.

Quoted 2 lines

+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: add some parenthesis here?
+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: maybe use && instead of &

These are real but they duplicate Sparse warnings. :/

Quoted 2 lines

arch/x86/boot/compressed/eboot.c:728 handle_ramdisks() error: potentially derefencing uninitialized 'fh'.

regards,
dan carpenter

#2 lore raw

Re: [pci:next 73/77] arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefen

In reply to Fengguang Wu

Just a reminder that the EFI ROM patches are not in my next branch yet. IIRC, there is a section mismatch issue as well as the one below.

Quoted 33 lines · Dan Carpenter
Quoted 11 lines · Fengguang Wu

Hi Matthew,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
head:   97ac9d1f363964dec7fbb20cf3c2e88336b4d801
commit: 66f2adcdadea18a583d4f7cbd773847d635731a3 [73/77] EFI: Stash ROMs if they're not in the PCI BAR

All smatch warnings:

+ arch/x86/boot/compressed/eboot.c:283 setup_efi_pci() error: potentially derefencing uninitialized 'pci_handle'.

These warnings probably have too high of a false positive rate to be worth emailing about. Although this one looks like a real bug. We should be passing "&pci_handle" to efi_call_phys5 instead of "pci_handle".

I'm not sure why GCC doesn't warn about these. Anyway, it's because GCC didn't warn about unitialized variables that I added it to Smatch.

Quoted 2 lines

+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: add some parenthesis here?
+ arch/x86/boot/compressed/eboot.c:303 setup_efi_pci() warn: maybe use && instead of &

These are real but they duplicate Sparse warnings. :/

Quoted 2 lines

arch/x86/boot/compressed/eboot.c:728 handle_ramdisks() error: potentially derefencing uninitialized 'fh'.

regards,
dan carpenter