Skip to contentSkip to conversation

Patch "[media] coda: restore original firmware locations" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message Jun 18, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

[media] coda: restore original firmware locations

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
coda-restore-original-firmware-locations.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 1e9b71d53ddc3b8df81ef6be052e31b70442a47f Mon Sep 17 00:00:00 2001

From: Philipp Zabel <[email protected]>
Date: Wed, 8 Mar 2017 09:30:50 -0300
Subject: [media] coda: restore original firmware locations

From: Philipp Zabel <[email protected]>

commit 1e9b71d53ddc3b8df81ef6be052e31b70442a47f upstream.

Recently, an unfinished patch was merged that added a third entry to the beginning of the array of firmware locations without changing the code to also look at the third element, thus pushing an old firmware location off the list.

Fixes 8af7779f3cbc ("[media] coda: add Freescale firmware compatibility location")
---
 drivers/media/platform/coda/coda-common.c |   21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/media/platform/coda/coda-common.c +13 -8
@@ -2126,7 +2126,12 @@ static void coda_fw_callback(const struc
 
 static int coda_firmware_request(struct coda_dev *dev)
 {
-	char *fw = dev->devtype->firmware[dev->firmware];
+	char *fw;
+
+	if (dev->firmware >= ARRAY_SIZE(dev->devtype->firmware))
+		return -EINVAL;
+
+	fw = dev->devtype->firmware[dev->firmware];
 
 	dev_dbg(&dev->plat_dev->dev, "requesting firmware '%s' for %s\n", fw,
 		coda_product_name(dev->devtype->product));
@@ -2142,16 +2147,16 @@ static void coda_fw_callback(const struc
 	struct platform_device *pdev = dev->plat_dev;
 	int i, ret;
 
-	if (!fw && dev->firmware == 1) {
-		v4l2_err(&dev->v4l2_dev, "firmware request failed\n");
-		goto put_pm;
-	}
 	if (!fw) {
-		dev->firmware = 1;
-		coda_firmware_request(dev);
+		dev->firmware++;
+		ret = coda_firmware_request(dev);
+		if (ret < 0) {
+			v4l2_err(&dev->v4l2_dev, "firmware request failed\n");
+			goto put_pm;
+		}
 		return;
 	}
-	if (dev->firmware == 1) {
+	if (dev->firmware > 0) {
 		/*
 		 * Since we can't suppress warnings for failed asynchronous
 		 * firmware requests, report that the fallback firmware was

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/coda-restore-original-firmware-locations.patch