Re: detecting misuse of of_get_property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 29, 2019 at 01:50:58PM +0300, Dan Carpenter wrote:
> +static void match_of_get_property(const char *fn, struct expression *expr, void *unused)
> +{
> +	struct expression *left = expr->left;
> +	struct symbol *type;
> +
> +	type = get_type(left);
> +	if (!type || type->type != SYM_PTR)
> +		return;
> +	type = get_base_type(type);
> +	if (type_bits(type) == 8)
> +		return;
> +	if (type->type == SYM_RESTRICT)
> +		return;

Wouldn't this also silently accept assignments to any bitwise
type: __le32, __be16, ... ? 

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux