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

Commit c422f19e authored by Lior Barenboim's avatar Lior Barenboim
Browse files

msm: ultrasound: ignore kmemleak false detection



The kmemleak tool detects a false memory leak, beacuse a
memory allocation result is assigned to a non-aligned
pointer. When kmemleak scans the memory for references
to this allocated block, it does not find any.

The fix adds a kmemleak call to explicity ignore this
allocation.

Change-Id: I0ebba2ff0a37485d649b195672f39e3138c36ec2
Signed-off-by: default avatarLior Barenboim <liorb@codeaurora.org>
parent 7ee16994
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/input.h>
#include <linux/uaccess.h>
#include <linux/time.h>
#include <linux/kmemleak.h>
#include <sound/apr_audio.h>
#include <linux/qdsp6v2/usf.h>
#include "q6usm.h"
@@ -572,6 +573,9 @@ static int config_xx(struct usf_xx_type *usf_xx, struct us_xx_info_type *config)
	if (config->params_data_size > 0) { /* transparent data copy */
		usf_xx->encdec_cfg.params = kzalloc(config->params_data_size,
						    GFP_KERNEL);
		/* False memory leak here - pointer in packed struct *
		* is undetected by kmemleak tool                    */
		kmemleak_ignore(usf_xx->encdec_cfg.params);
		if (usf_xx->encdec_cfg.params == NULL) {
			pr_err("%s: params memory alloc[%d] failure\n",
				__func__,