tech-kern archive

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

Re: fdtbus_attach_i2cbus prop_object_release




> On Apr 23, 2019, at 9:39 AM, yarl-baudig%mailoo.org@localhost wrote:
> 
> Hello,
> 
> May I suggest the following patch?

You may, in fact!  Thanks, I just checked it in.

> 
> diff --git a/sys/dev/fdt/fdt_i2c.c b/sys/dev/fdt/fdt_i2c.c
> index 801bf5b52391..34f1c8a3e406 100644
> --- a/sys/dev/fdt/fdt_i2c.c
> +++ b/sys/dev/fdt/fdt_i2c.c
> @@ -104,6 +104,7 @@ fdtbus_i2c_acquire(int phandle, const char *prop)
> device_t
> fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print)
> {
> +	device_t ret;
> 	struct i2cbus_attach_args iba;
> 	prop_dictionary_t devs, props;
> 	u_int address_cells;
> @@ -124,5 +125,9 @@ fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print)
> 	props = device_properties(dev);
> 	prop_dictionary_set_bool(props, "i2c-indirect-config", false);
> 
> -	return config_found_ia(dev, "i2cbus", &iba, print);
> +	ret = config_found_ia(dev, "i2cbus", &iba, print);
> +	if (iba.iba_child_devices)
> +		prop_object_release(iba.iba_child_devices);
> +
> +	return ret;
> }
> 
> Thank you.
> yarl
> 
> 

-- thorpej



Home | Main Index | Thread Index | Old Index