diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d69699973b58..68699b3e7998 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4014,8 +4014,14 @@ int strn_pattern_cmp(const char *patt, const char *name, int wildchar) | |||
4014 | p = strchr(patt, wildchar); | 4014 | p = strchr(patt, wildchar); |
4015 | if (p && ((*(p + 1)) == 0)) | 4015 | if (p && ((*(p + 1)) == 0)) |
4016 | len = p - patt; | 4016 | len = p - patt; |
4017 | else | 4017 | else { |
4018 | len = strlen(name); | 4018 | len = strlen(name); |
4019 | if (!len) { | ||
4020 | if (!*patt) | ||
4021 | return 0; | ||
4022 | return -1; | ||
4023 | } | ||
4024 | } | ||
4019 | 4025 | ||
4020 | return strncmp(patt, name, len); | 4026 | return strncmp(patt, name, len); |
4021 | } | 4027 | } |