]> git.proxmox.com Git - grub2.git/commitdiff
disk/dmraid_nvidia: Format string error in grub_error()
authorGlenn Washburn <development@efficientek.com>
Fri, 5 Mar 2021 00:22:35 +0000 (18:22 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 10 Mar 2021 13:50:44 +0000 (14:50 +0100)
The grub_error() has a format string expecting two arguments, but only one
provided. According to the comments in the struct grub_nv_super definition,
the version field looks like a version number where major.minor is encoded
as each a byte in the two-byte short.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/dmraid_nvidia.c

index 4d2fb04d1265d31d03b3b0b9d32c4611023972b7..6372663e65d3c1871d4e05ef00bef07e1ae3de80 100644 (file)
@@ -122,7 +122,7 @@ grub_dmraid_nv_detect (grub_disk_t disk,
   if (sb.version != NV_VERSION)
     {
       grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
-                 "unknown version: %d.%d", sb.version);
+                 "unknown version: %d.%d", sb.version >> 8, sb.version & 0xFF);
       return NULL;
     }