Kaynağa Gözat

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

tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
028bc034e4
1 değiştirilmiş dosya ile 6 ekleme ve 4 silme
  1. 6
    4
      src/util/makerom.pl

+ 6
- 4
src/util/makerom.pl Dosyayı Görüntüle

@@ -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…
İptal
Kaydet