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

Commit c65171cf authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] bt8xx: remove needless check



As reported by smatch:
	drivers/media/pci/bt8xx/dst_ca.c:323 ca_get_message() warn: this array is probably non-NULL. 'p_ca_message->msg'
	drivers/media/pci/bt8xx/dst_ca.c:498 ca_send_message() warn: this array is probably non-NULL. 'p_ca_message->msg'

Those two checks are needless/useless, as the ca_msg struct is
declared as:
typedef struct ca_msg {
        unsigned int index;
        unsigned int type;
        unsigned int length;
        unsigned char msg[256];
} ca_msg_t;

So, if the p_ca_message pointer is not null, msg will also be
not null.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 91aff0c5
Loading
Loading
Loading
Loading
+67 −71
Original line number Diff line number Diff line
@@ -320,7 +320,6 @@ static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message,
	if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg)))
		return -EFAULT;

	if (p_ca_message->msg) {
	dprintk(verbose, DST_CA_NOTICE, 1, " Message = [%*ph]",
		3, p_ca_message->msg);

@@ -343,7 +342,6 @@ static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message,
			return -EFAULT;
		break;
	}
	}

	return 0;
}
@@ -494,8 +492,6 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
		goto free_mem_and_exit;
	}


	if (p_ca_message->msg) {
	/*	EN50221 tag	*/
	command = 0;

@@ -547,7 +543,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
		dprintk(verbose, DST_CA_INFO, 1, " -->CA_INFO_ENQUIRY Success !");
		break;
	}
	}

free_mem_and_exit:
	kfree (hw_buffer);