Skip to content

Commit 5fbbcae

Browse files
Jan Moskyto Matejkagregkh
authored andcommitted
Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
commit 03b5632 upstream. Commit afe2dab ("USB: add hex/bcd detection to usb modalias generation") changed the routine that generates alias ranges. Before that change, only digits 0-9 were supported; the commit tried to fix the case when the range includes higher values than 0x9. Unfortunately, the commit didn't fix the case when the range includes both 0x9 and 0xA, meaning that the final range must look like [x-9A-y] where x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced. Modprobe doesn't complain as it sees no difference between no-match and bad-pattern results of fnmatch(). Fixing this simple bug to fix the aliases. Also changing the hardcoded beginning of the range to uppercase as all the other letters are also uppercase in the device version numbers. Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK. Signed-off-by: Jan Moskyto Matejka <mq@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6cafd97 commit 5fbbcae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/mod/file2alias.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ static void do_usb_entry(void *symval,
208208
range_lo < 0x9 ? "[%X-9" : "[%X",
209209
range_lo);
210210
sprintf(alias + strlen(alias),
211-
range_hi > 0xA ? "a-%X]" : "%X]",
212-
range_lo);
211+
range_hi > 0xA ? "A-%X]" : "%X]",
212+
range_hi);
213213
}
214214
}
215215
if (bcdDevice_initial_digits < (sizeof(bcdDevice_lo) * 2 - 1))

0 commit comments

Comments
 (0)