From f3f92dde4719ac771d671a069ba5588a796d28a6 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Sat, 5 Apr 2014 15:27:06 +0200 Subject: [PATCH] qr: print_oops: don't compress if we don't have a framebuffer Since compressing and encoding the data makes no sense if we can't output it later, restructure the function to quickly quit if there is no framebuffer. Signed-off-by: Levente Kurusa --- kernel/print_oops.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/kernel/print_oops.c b/kernel/print_oops.c index 00388f1..042f8ea 100644 --- a/kernel/print_oops.c +++ b/kernel/print_oops.c @@ -124,18 +124,17 @@ void print_qr_err(void) if (!qr_oops) return; + info = registered_fb[0]; + if (!info) { + printk(KERN_WARNING "Unable to get hand of a framebuffer!\n"); + return; + } + compr_len = qr_compress(qr_buffer, compr_qr_buffer, buf_pos, buf_pos); if (compr_len < 0) return; - qr = QRcode_encodeData(compr_len, compr_qr_buffer, 0, QR_ECLEVEL_H); - - info = registered_fb[0]; - if (!info) { - printk(KERN_WARNING "Unable to get hand of a framebuffer!\n"); - goto exit; - } w = compute_w(info, qr->width); rect.width = w; @@ -177,7 +176,6 @@ void print_qr_err(void) } } -exit: QRcode_free(qr); qr_compr_exit(); buf_pos = 0; -- 1.8.3.1