]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gs1662: drop kfree for memory allocated with devm_kzalloc
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 21 Sep 2016 13:09:39 +0000 (10:09 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jan 2017 07:24:45 +0000 (08:24 +0100)
commit df94121f02ecce435d6b5277071eb94b764caa89 upstream.

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 7aae6e2df127 ("[media] Add GS1662 driver, a video serializer")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/spi/gs1662.c

index d76f36233f430541791441301ea8cff29eab52dd..5143a90219c0842ebb18efcd4b4049a60db70913 100644 (file)
@@ -453,10 +453,9 @@ static int gs_probe(struct spi_device *spi)
 static int gs_remove(struct spi_device *spi)
 {
        struct v4l2_subdev *sd = spi_get_drvdata(spi);
-       struct gs *gs = to_gs(sd);
 
        v4l2_device_unregister_subdev(sd);
-       kfree(gs);
+
        return 0;
 }