Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db03d0b9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "firmware_class: Correct a null check in firmware_direct_read"

parents 179fd82c 6be49920
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -725,6 +725,9 @@ static ssize_t firmware_direct_read(struct file *filp, struct kobject *kobj,
	struct firmware *fw;
	ssize_t ret_count;

	if (!fw_priv->fw)
		return -ENODEV;

	mutex_lock(&fw_lock);
	fw = fw_priv->fw;

@@ -735,7 +738,7 @@ static ssize_t firmware_direct_read(struct file *filp, struct kobject *kobj,
	if (count > fw->size - offset)
		count = fw->size - offset;

	if (!fw || test_bit(FW_STATUS_DONE, &fw_priv->buf->status)) {
	if (test_bit(FW_STATUS_DONE, &fw_priv->buf->status)) {
		ret_count = -ENODEV;
		goto out;
	}