diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2016-11-02 03:24:39 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-12-05 04:31:09 -0500 |
commit | a48ee3e65a9e7395e8bab86728fcdc81c30a89ca (patch) | |
tree | 70df777c1ef3238eb9b96f88c31448644b0f4c65 /drivers/mmc | |
parent | 5df0e8231f9518ee5ca3f58a0777556dd03addd6 (diff) |
mmc: debugfs: remove BUG_ON from mmc_ext_csd_open
Return error value for file_operations callback instead
of triggering BUG_ON which is meaningless. Personally I
don't believe n != EXT_CSD_STR_LEN could happen. Anyway,
propagate the error to the caller.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/debugfs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index c8451ce557ae..30623b8b86a4 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c | |||
@@ -321,7 +321,11 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp) | |||
321 | for (i = 0; i < 512; i++) | 321 | for (i = 0; i < 512; i++) |
322 | n += sprintf(buf + n, "%02x", ext_csd[i]); | 322 | n += sprintf(buf + n, "%02x", ext_csd[i]); |
323 | n += sprintf(buf + n, "\n"); | 323 | n += sprintf(buf + n, "\n"); |
324 | BUG_ON(n != EXT_CSD_STR_LEN); | 324 | |
325 | if (n != EXT_CSD_STR_LEN) { | ||
326 | err = -EINVAL; | ||
327 | goto out_free; | ||
328 | } | ||
325 | 329 | ||
326 | filp->private_data = buf; | 330 | filp->private_data = buf; |
327 | kfree(ext_csd); | 331 | kfree(ext_csd); |