]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: Fix crash when calling PDC_PAT_MEM PDT firmware function
authorHelge Deller <deller@gmx.de>
Tue, 25 Jul 2017 16:20:54 +0000 (18:20 +0200)
committerHelge Deller <deller@gmx.de>
Tue, 25 Jul 2017 16:24:39 +0000 (18:24 +0200)
commit5b1d9c41ed8cd8c92c21b708e478998aa33b9e4b
treefa785945c28ff2e0d3c777d2f4a59fdf92756716
parent66064aeecf9f0588663ea95253d3048d2c131550
parisc: Fix crash when calling PDC_PAT_MEM PDT firmware function

Commit 07f9e5c2eb6d ("parisc: Add Page Deallocation Table (PDT) support")
introduced the pdc_pat_mem_read_pd_pdt() firmware helper function, which
crashed the system because it trashed the stack if the
pdc_pat_mem_read_pd_retinfo struct was located on the stack (and which is
in size less than the required 32 64-bit values).

Fix it by using the pdc_result struct instead when calling firmware and copy
the return values back into the result struct when finished sucessfully.

While debugging this code I noticed that the pdc_type wasn't set correctly
either, so let's fix that too.

Fixes: 07f9e5c2eb6d ("parisc: Add Page Deallocation Table (PDT) support")
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/firmware.c
arch/parisc/kernel/pdt.c