]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] mn88472: Fix possible leak in mn88472_init()
authorChristian Engelmayer <cengelma@gmx.at>
Sat, 2 May 2015 21:59:29 +0000 (18:59 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 12 May 2015 16:26:30 +0000 (13:26 -0300)
Commit 307e95c92257 ("[media] mn88472: implement firmware parity check")
introduced the usage of exit paths that do not free the already allocated
firmware data in case the parity handling fails. Go through the correct
exit paths. Detected by Coverity CID 1295989.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Acked-by: Benjamin Larsson <benjamin@southpole.se>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/mn88472/mn88472.c

index a4cfcf57c99c0d37d6fcd7b100f4b1f25d8d5ec2..6863c431c64804976458f7ae56e8b5eb38cb0b44 100644 (file)
@@ -344,12 +344,12 @@ static int mn88472_init(struct dvb_frontend *fe)
        if (ret) {
                dev_err(&client->dev,
                                "parity reg read failed=%d\n", ret);
-               goto err;
+               goto firmware_release;
        }
        if (tmp & 0x10) {
                dev_err(&client->dev,
                                "firmware parity check failed=0x%x\n", tmp);
-               goto err;
+               goto firmware_release;
        }
        dev_err(&client->dev, "firmware parity check succeeded=0x%x\n", tmp);