From: Christoph Hellwig Date: Sun, 4 Jun 2023 14:56:49 +0000 (+0200) Subject: bcache: don't pass a stack address to blkdev_get_by_path X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=13dd58cce8d23692e21c9fad3ca41aa19ecc4c82;p=users%2Fhch%2Fblock.git bcache: don't pass a stack address to blkdev_get_by_path sb is just an on-stack pointer that can easily be reused by other calls. Switch to use the bcache-wide bcache_kobj instead as there is no need to claim per-bcache device anyway. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 94b91c45c9e2..4a2aed047aec 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -2560,7 +2560,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, err = "failed to open device"; bdev = blkdev_get_by_path(strim(path), FMODE_READ|FMODE_WRITE|FMODE_EXCL, - sb, NULL); + bcache_kobj, NULL); if (IS_ERR(bdev)) { if (bdev == ERR_PTR(-EBUSY)) { dev_t dev;