All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Laager <rlaager@wiktel.com>
To: grub-devel@gnu.org
Subject: [PATCH] diskfilter: Treat an unrecognized RAID level as an error
Date: Sat, 04 Feb 2012 16:01:17 -0600	[thread overview]
Message-ID: <1328392877.5007.38.camel@watermelon.coderich.net> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 253 bytes --]

disk/diskfilter.c: In function 'grub_diskfilter_make_raid':
disk/diskfilter.c:847:21: error: 'totsize' may be used uninitialized in
this function [-Werror=uninitialized]

Perhaps my patch should use assert() instead of return NULL?

-- 
Richard

[-- Attachment #1.2: Type: text/x-patch, Size: 860 bytes --]

diskfilter: Treat an unrecognized RAID level as an error

disk/diskfilter.c: In function 'grub_diskfilter_make_raid':
disk/diskfilter.c:847:21: error: 'totsize' may be used uninitialized in this function [-Werror=uninitialized]

Perhaps this should be an assert() instead of return NULL?

=== modified file 'grub-core/disk/diskfilter.c'
Index: grub/grub-core/disk/diskfilter.c
===================================================================
--- grub.orig/grub-core/disk/diskfilter.c	2012-02-04 15:42:05.511916000 -0600
+++ grub/grub-core/disk/diskfilter.c	2012-02-04 15:50:17.059270000 -0600
@@ -837,6 +837,9 @@ grub_diskfilter_make_raid (grub_size_t u
     case 6:
       totsize = (nmemb - level / 3) * disk_size;
       break;
+
+    default:
+      return NULL;
     }
 
   array = grub_diskfilter_get_vg_by_uuid (uuidlen, uuid);

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2012-02-04 22:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 22:01 Richard Laager [this message]
2012-02-04 22:30 ` [PATCH] diskfilter: Treat an unrecognized RAID level as an error Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-04 23:00   ` Richard Laager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328392877.5007.38.camel@watermelon.coderich.net \
    --to=rlaager@wiktel.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.