lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210726113711.GI1931@kadam>
Date:   Mon, 26 Jul 2021 14:37:11 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     Martin Kepplinger <martin.kepplinger@...i.sm>, shawnguo@...nel.org,
        devicetree@...r.kernel.org, festevam@...il.com,
        kernel@...gutronix.de, kernel@...i.sm, krzk@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-imx@....com,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        linux-staging@...ts.linux.dev, m.felsch@...gutronix.de,
        mchehab@...nel.org, phone-devel@...r.kernel.org, robh@...nel.org,
        slongerbeam@...il.com
Subject: Re: [PATCH v8 2/3] media: imx: add a driver for i.MX8MQ mipi csi rx
 phy and controller

On Sat, Jul 24, 2021 at 02:14:08AM +0300, Laurent Pinchart wrote:
> > +static int imx8mq_mipi_csi_calc_hs_settle(struct csi_state *state)
> > +{
> > +	s64 link_freq;
> > +	u32 lane_rate;
> > +	u32 esc_clk_rate = 0;
> 
> This should be an unsigned long.
> 

I have created a Smatch check for this.

regards,
dan carpenter

#include "smatch.h"
#include "smatch_slist.h"

static int my_id;

static void check_type(struct expression *expr, const char *name, struct symbol *sym, void *data)
{
	struct symbol *type = data;
	int bits;

	if (!expr || expr->type != EXPR_ASSIGNMENT)
		return;

	bits = type_bits(get_type(expr->left));
	if (bits >= type_bits(type))
		return;
	sm_msg("wrong type for '%s' (should be '%s')", name, type_to_str(type));
}

void check_clk_get_rate_returns_ul(int id)
{
	my_id = id;

	add_function_param_key_hook("clk_get_rate", &check_type, -1, "$", &ulong_ctype);
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ