All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] diskfilter: Treat an unrecognized RAID level as an error
@ 2012-02-04 22:01 Richard Laager
  2012-02-04 22:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Laager @ 2012-02-04 22:01 UTC (permalink / raw)
  To: grub-devel


[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-04 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-04 22:01 [PATCH] diskfilter: Treat an unrecognized RAID level as an error Richard Laager
2012-02-04 22:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-02-04 23:00   ` Richard Laager

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.