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

Commit b452d611 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ba: Update printk format specifier to prevent leaks"

parents c5ae1075 cd25e10a
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -53,7 +53,7 @@ int msm_ba_querycap(void *instance, struct v4l2_capability *cap)

	if (!inst || !cap) {
		dprintk(BA_ERR,
			"Invalid input, inst = 0x%p, cap = 0x%p", inst, cap);
			"Invalid input, inst = 0x%pK, cap = 0x%pK", inst, cap);
		return -EINVAL;
	}

@@ -77,7 +77,7 @@ int msm_ba_g_priority(void *instance, enum v4l2_priority *prio)

	if (!inst || !prio) {
		dprintk(BA_ERR,
			"Invalid prio, inst = 0x%p, prio = 0x%p", inst, prio);
			"Invalid prio, inst = 0x%pK, prio = 0x%pK", inst, prio);
		return -EINVAL;
	}

@@ -681,7 +681,7 @@ static int msm_ba_register_v4l2_subdev(struct v4l2_device *v4l2_dev,
	struct video_device *vdev;
	int rc = 0;

	dprintk(BA_DBG, "Enter %s: v4l2_dev 0x%p, v4l2_subdev 0x%p",
	dprintk(BA_DBG, "Enter %s: v4l2_dev 0x%pK, v4l2_subdev 0x%pK",
			  __func__, v4l2_dev, sd);
	if (NULL == v4l2_dev || NULL == sd || !sd->name[0]) {
		dprintk(BA_ERR, "Invalid input");
@@ -933,7 +933,7 @@ int msm_ba_close(void *instance)

	debugfs_remove_recursive(inst->debugfs_root);

	dprintk(BA_DBG, "Closed BA instance: %p", inst);
	dprintk(BA_DBG, "Closed BA instance: %pK", inst);
	kfree(inst);

	return rc;
+10 −10
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ static ssize_t dev_info_read(struct file *file, char __user *buf,
	ssize_t size = 0;

	if (!dev_ctxt) {
		dprintk(BA_ERR, "Invalid params, dev: 0x%p", dev_ctxt);
		dprintk(BA_ERR, "Invalid params, dev: 0x%pK", dev_ctxt);
		return 0;
	}

@@ -70,7 +70,7 @@ static ssize_t dev_info_read(struct file *file, char __user *buf,

	INIT_DBG_BUF(dbg_buf);
	write_str(dbg_buf, "===============================");
	write_str(dbg_buf, "DEV: 0x%p", dev_ctxt);
	write_str(dbg_buf, "DEV: 0x%pK", dev_ctxt);
	write_str(dbg_buf, "===============================");
	write_str(dbg_buf, "state: %d", dev_ctxt->state);

@@ -102,7 +102,7 @@ struct dentry *msm_ba_debugfs_init_drv(void)
	struct dentry *f = debugfs_create_##__type(__name, S_IRUGO | S_IWUSR, \
		dir, __value);                                                \
	if (IS_ERR_OR_NULL(f)) {                                              \
		dprintk(BA_ERR, "Failed creating debugfs file '%pd/%s'",  \
		dprintk(BA_ERR, "Failed creating debugfs file '%pKd/%s'",  \
			dir, __name);                                         \
		f = NULL;                                                     \
	}                                                                     \
@@ -135,11 +135,11 @@ struct dentry *msm_ba_debugfs_init_dev(struct msm_ba_dev *dev_ctxt,
	char debugfs_name[MAX_DEBUGFS_NAME];

	if (!dev_ctxt) {
		dprintk(BA_ERR, "Invalid params, core: %p", dev_ctxt);
		dprintk(BA_ERR, "Invalid params, core: %pK", dev_ctxt);
		goto failed_create_dir;
	}

	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "dev_%p", dev_ctxt);
	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "dev_%pK", dev_ctxt);
	dir = debugfs_create_dir(debugfs_name, parent);
	if (!dir) {
		dprintk(BA_ERR, "Failed to create debugfs for msm_ba");
@@ -168,7 +168,7 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,
	ssize_t size = 0;

	if (!inst) {
		dprintk(BA_ERR, "Invalid params, dev: %p", inst);
		dprintk(BA_ERR, "Invalid params, dev: %pK", inst);
		return 0;
	}

@@ -178,10 +178,10 @@ static ssize_t inst_info_read(struct file *file, char __user *buf,

	INIT_DBG_BUF(dbg_buf);
	write_str(dbg_buf, "===============================");
	write_str(dbg_buf, "INSTANCE: %p (%s)", inst,
	write_str(dbg_buf, "INSTANCE: %pK (%s)", inst,
								"BA device");
	write_str(dbg_buf, "===============================");
	write_str(dbg_buf, "dev: %p", inst->dev_ctxt);
	write_str(dbg_buf, "dev: %pK", inst->dev_ctxt);
	write_str(dbg_buf, "state: %d", inst->state);

	size = simple_read_from_buffer(buf, count, ppos,
@@ -204,10 +204,10 @@ struct dentry *msm_ba_debugfs_init_inst(struct msm_ba_inst *inst,
	char debugfs_name[MAX_DEBUGFS_NAME];

	if (!inst) {
		dprintk(BA_ERR, "Invalid params, inst: %p", inst);
		dprintk(BA_ERR, "Invalid params, inst: %pK", inst);
		goto failed_create_dir;
	}
	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "inst_%p", inst);
	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "inst_%pK", inst);
	dir = debugfs_create_dir(debugfs_name, parent);
	if (!dir) {
		dprintk(BA_ERR, "Failed to create debugfs for msm_ba");
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -387,7 +387,7 @@ static int msm_ba_device_init(struct platform_device *pdev,
	if ((NULL == ret_dev_ctxt) ||
			(NULL != *ret_dev_ctxt) ||
			(NULL == pdev)) {
		dprintk(BA_ERR, "%s(%d) Invalid params %p %p %p",
		dprintk(BA_ERR, "%s(%d) Invalid params %pK %pK %pK",
			__func__, __LINE__,
			ret_dev_ctxt, *ret_dev_ctxt, pdev);
		return -EINVAL;
@@ -471,7 +471,7 @@ static int msm_ba_probe(struct platform_device *pdev)
	struct ba_ctxt *ba_ctxt;
	int rc = 0;

	dprintk(BA_INFO, "Enter %s: pdev %p device id = %d",
	dprintk(BA_INFO, "Enter %s: pdev %pK device id = %d",
		__func__, pdev, pdev->id);
	ba_ctxt = msm_ba_get_ba_context();