summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-blackbird.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-07-19 12:49:39 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-07-19 12:49:39 -0300
commitded9757de77adb99448ab46d12602aad60d3a737 (patch)
tree3f13329d0f1a4308018023b0257e198f049d1793 /linux/drivers/media/video/cx88/cx88-blackbird.c
parente0fd938d1ef7a331ffb7abc324c60be339de960b (diff)
downloadmediapointer-dvb-s2-ded9757de77adb99448ab46d12602aad60d3a737.tar.gz
mediapointer-dvb-s2-ded9757de77adb99448ab46d12602aad60d3a737.tar.bz2
[PATCH] release_firmware() fixes
From: Magnus Damm <magnus@valinux.co.jp> Use release_firmware() to free requested resources. According to Documentation/firmware_class/README the request_firmware() call should be followed by a release_firmware(). Some drivers do not however free the firmware previously allocated with request_firmware(). This patch tries to fix this by making sure that release_firmware() is used as expected. kernel-sync: backport from kernel to v4l/dvb tree Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-blackbird.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-blackbird.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c
index cdc4e76fe..5888eb2dd 100644
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c
@@ -464,11 +464,13 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) {
dprintk(0, "ERROR: Firmware size mismatch (have %zd, expected %d)\n",
firmware->size, BLACKBIRD_FIRM_IMAGE_SIZE);
+ release_firmware(firmware);
return -1;
}
if (0 != memcmp(firmware->data, magic, 8)) {
dprintk(0, "ERROR: Firmware magic mismatch, wrong file?\n");
+ release_firmware(firmware);
return -1;
}
@@ -489,6 +491,7 @@ static int blackbird_load_firmware(struct cx8802_dev *dev)
}
if (checksum) {
dprintk(0, "ERROR: Firmware load failed (checksum mismatch).\n");
+ release_firmware(firmware);
return -1;
}
release_firmware(firmware);