cmd: host: fix seg fault at "host info"
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Thu, 22 Aug 2019 07:47:39 +0000 (16:47 +0900)
committerTom Rini <trini@konsulko.com>
Sun, 6 Oct 2019 19:20:53 +0000 (15:20 -0400)
With the patch below applied, host_block_dev structure was switched
to be placed in platdata rather than priv. The command "host info"
must be aligned with this change. Otherwise, we will see "Segmentation
Fault."

Fixes: 8f994c860d91 ("sandbox: blk: Switch to use platdata_auto_alloc_size for the driver data")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/host.c

index f7d3eae5b1ad1313f0ee8032fe69ac2df556be65..98c4d2a099e972354114d6fcfb0efb158e33dbad 100644 (file)
@@ -89,7 +89,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
                struct host_block_dev *host_dev;
 
 #ifdef CONFIG_BLK
-               host_dev = dev_get_priv(blk_dev->bdev);
+               host_dev = dev_get_platdata(blk_dev->bdev);
 #else
                host_dev = blk_dev->priv;
 #endif