This patch adds missing error handling check against the return value of
'set_bootargs()' in 'kexec-arm64.c'


Cc: Simon Horman <[email protected]>
Cc: AKASHI Takahiro <[email protected]>
Cc: Vicente Bergas <[email protected]>
Signed-off-by: Bhupesh Sharma <[email protected]>
---
 kexec/arch/arm64/kexec-arm64.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
index b143e861f7d9..f4913b2e9480 100644
--- a/kexec/arch/arm64/kexec-arm64.c
+++ b/kexec/arch/arm64/kexec-arm64.c
@@ -413,6 +413,11 @@ static int setup_2nd_dtb(struct dtb *dtb, char 
*command_line, int on_crash)
        }
 
        result = set_bootargs(dtb, command_line);
+       if (result) {
+               fprintf(stderr, "kexec: cannot set bootargs.\n");
+               result = -EINVAL;
+               goto on_error;
+       }
 
        /* determine #address-cells and #size-cells */
        result = get_cells_size(dtb->buf, &address_cells, &size_cells);
-- 
2.7.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to