瀏覽代碼

Always update the PnP checksum, even if the ident string is not being set.

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
028bc034e4
共有 1 個檔案被更改,包括 6 行新增4 行删除
  1. 6
    4
      src/util/makerom.pl

+ 6
- 4
src/util/makerom.pl 查看文件

@@ -88,10 +88,12 @@ sub pcipnpheaders ($$) {
88 88
 				= pack('v', oct($pci_device_id)) if ($pci_device_id);
89 89
 		}
90 90
 	}
91
-	if ($pnp_hdr_offset > 0 and defined($identoffset)) {
92
-		# Point to device id string at end of ROM image
93
-		substr($$romref, $pnp_hdr_offset+PNP_DEVICE_OFF, 2)
94
-			= pack('v', $identoffset);
91
+	if ($pnp_hdr_offset > 0) {
92
+		if (defined($identoffset)) {
93
+			# Point to device id string at end of ROM image
94
+			substr($$romref, $pnp_hdr_offset+PNP_DEVICE_OFF, 2)
95
+				= pack('v', $identoffset);
96
+		}
95 97
 		substr($$romref, $pnp_hdr_offset+PNP_CHKSUM_OFF, 1) = "\x00";
96 98
 		my $sum = unpack('%8C*', substr($$romref, $pnp_hdr_offset,
97 99
 			PNP_HDR_SIZE));

Loading…
取消
儲存