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

Commit 7457be3b authored by Mohammed Siddiq's avatar Mohammed Siddiq
Browse files

cnss2: Avoid null pointer dereference of cnss_platform_cap



Add change to avoid null pointer dereference of cnss_platform_cap.

Change-Id: Ib48f192a54c8d48031d5fbc743622af6c2fdb19c
Signed-off-by: default avatarMohammed Siddiq <msiddiq@codeaurora.org>
parent 26fe5533
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -203,9 +203,10 @@ int cnss_get_platform_cap(struct device *dev, struct cnss_platform_cap *cap)
	if (!plat_priv)
		return -ENODEV;

	if (cap)
		*cap = plat_priv->cap;
	if (!cap)
		return -EINVAL;

	*cap = plat_priv->cap;
	cnss_pr_dbg("Platform cap_flag is 0x%x\n", cap->cap_flag);

	return 0;