Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: e500: fix handling local_sid_lookup result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Andrzej Hajda and committed by
Paul Mackerras
d4cd4f95 6a14c222

+2 -1
+2 -1
arch/powerpc/kvm/e500.c
··· 237 237 struct kvm_book3e_206_tlb_entry *gtlbe) 238 238 { 239 239 struct vcpu_id_table *idt = vcpu_e500->idt; 240 - unsigned int pr, tid, ts, pid; 240 + unsigned int pr, tid, ts; 241 + int pid; 241 242 u32 val, eaddr; 242 243 unsigned long flags; 243 244