[PATCH] clk: Check that ops of composite clock components exist, before calling

Sean Anderson seanga2 at gmail.com
Wed Dec 25 06:41:32 CET 2019


On 12/25/19 12:20 AM, Sean Anderson wrote:
> 				   int num_parents, struct clk *mux,
> @@ -94,7 +106,9 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
>  	struct clk *clk;
>  	struct clk_composite *composite;
>  	int ret;
> -	struct clk_ops *composite_ops = &clk_composite_ops;
> +
> +	if (!num_parents || (num_parents == 1 && !mux))

this should be

if (!num_parents || (num_parents != 1 && !mux))

> +		return ERR_PTR(-EINVAL);
> 
>  	composite = kzalloc(sizeof(*composite), GFP_KERNEL);
>  	if (!composite)


More information about the U-Boot mailing list