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

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

Merge "mfd: wcd9xxx: Add range checking in function wcd9xxx_init_slimslave"

parents f4c7cab9 89d80785
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, 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
@@ -62,6 +62,10 @@ int wcd9xxx_init_slimslave(struct wcd9xxx *wcd9xxx, u8 wcd9xxx_pgd_la,
		goto err;
	}

	if (!rx_num || rx_num > wcd9xxx->num_rx_port) {
		pr_err("%s: invalid rx num %d\n", __func__, rx_num);
		return -EINVAL;
	}
	if (wcd9xxx->rx_chs) {
		wcd9xxx->num_rx_port = rx_num;
		for (i = 0; i < rx_num; i++) {
@@ -84,6 +88,10 @@ int wcd9xxx_init_slimslave(struct wcd9xxx *wcd9xxx, u8 wcd9xxx_pgd_la,
			wcd9xxx->num_rx_port);
	}

	if (!tx_num || tx_num > wcd9xxx->num_tx_port) {
		pr_err("%s: invalid tx num %d\n", __func__, tx_num);
		return -EINVAL;
	}
	if (wcd9xxx->tx_chs) {
		wcd9xxx->num_tx_port = tx_num;
		for (i = 0; i < tx_num; i++) {