From: Geert Uytterhoeven Date: Mon, 19 Dec 2016 14:03:44 +0000 (+0100) Subject: mmc: block: Avoid uninitialized warning in mmc_blk_issue_discard_rq() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8cb6ed17eb30f190f215031844433981644b064d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mmc: block: Avoid uninitialized warning in mmc_blk_issue_discard_rq() With gcc-4.1.2: mmc/core/block.c: In function ‘mmc_blk_issue_discard_rq’: mmc/core/block.c:1150: warning: ‘arg’ may be used uninitialized in this function mmc/core/block.c:1150: warning: ‘nr’ may be used uninitialized in this function mmc/core/block.c:1150: warning: ‘from’ may be used uninitialized in this function While this is a false positive, it can be avoided easily by jumping over the checks for "err" that are always false. Signed-off-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index cb1698f268f1..5f942a34d65c 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1152,7 +1152,7 @@ static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req) if (!mmc_can_erase(card)) { err = -EOPNOTSUPP; - goto out; + goto fail; } from = blk_rq_pos(req); @@ -1181,6 +1181,7 @@ out: goto retry; if (!err) mmc_blk_reset_success(md, type); +fail: blk_end_request(req, err, blk_rq_bytes(req)); return err ? 0 : 1;