diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2021-02-07 15:46:47 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2021-02-07 15:47:04 +0200 |
commit | 1a1cc3d6bcfe9636eed3abf719bd27f5532f4ddd (patch) | |
tree | 5fbd48aeb13c3b49255dfa71d4423b27d3464997 /drivers/md | |
parent | 0c2a5838a4964533d885f646814fce22c8e813f0 (diff) | |
parent | 32ed4c6cace37c492b7deacdf3fa223618b1ad2e (diff) |
Merge remote-tracking branch 'msm8998/lineage-18.1' into lineage-18.1
Conflicts:
drivers/iio/adc/qcom-rradc.c
drivers/power/supply/qcom/fg-core.h
drivers/power/supply/qcom/fg-memif.c
drivers/power/supply/qcom/fg-reg.h
drivers/power/supply/qcom/fg-util.c
drivers/power/supply/qcom/qpnp-fg-gen3.c
include/linux/power_supply.h
Change-Id: Ia9367e04097cacda9c8cb3568e7e8916474b7205
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-table.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 6bb4dcc76230..3d6523f4acd6 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -394,14 +394,23 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, { int r; dev_t dev; + unsigned int major, minor; + char dummy; struct dm_dev_internal *dd; struct dm_table *t = ti->table; BUG_ON(!t); - dev = dm_get_dev_t(path); - if (!dev) - return -ENODEV; + if (sscanf(path, "%u:%u%c", &major, &minor, &dummy) == 2) { + /* Extract the major/minor numbers */ + dev = MKDEV(major, minor); + if (MAJOR(dev) != major || MINOR(dev) != minor) + return -EOVERFLOW; + } else { + dev = dm_get_dev_t(path); + if (!dev) + return -ENODEV; + } dd = find_device(&t->devices, dev); if (!dd) { |