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

Commit 239034f0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 4.14.169 into android-4.14



Changes in 4.14.169
	can, slip: Protect tty->disc_data in write_wakeup and close with RCU
	firestream: fix memory leaks
	gtp: make sure only SOCK_DGRAM UDP sockets are accepted
	ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions
	net: cxgb3_main: Add CAP_NET_ADMIN check to CHELSIO_GET_MEM
	net, ip6_tunnel: fix namespaces move
	net, ip_tunnel: fix namespaces move
	net_sched: fix datalen for ematch
	net-sysfs: Fix reference count leak in rx|netdev_queue_add_kobject
	net-sysfs: fix netdev_queue_add_kobject() breakage
	net-sysfs: Call dev_hold always in netdev_queue_add_kobject
	net-sysfs: Call dev_hold always in rx_queue_add_kobject
	net-sysfs: Fix reference count leak
	net: usb: lan78xx: Add .ndo_features_check
	tcp_bbr: improve arithmetic division in bbr_update_bw()
	net: rtnetlink: validate IFLA_MTU attribute in rtnl_create_link()
	hwmon: (adt7475) Make volt2reg return same reg as reg2volt input
	hwmon: Deal with errors from the thermal subsystem
	hwmon: (core) Fix double-free in __hwmon_device_register()
	hwmon: (core) Do not use device managed functions for memory allocations
	Input: keyspan-remote - fix control-message timeouts
	Revert "Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers"
	ARM: 8950/1: ftrace/recordmcount: filter relocation types
	mmc: tegra: fix SDR50 tuning override
	mmc: sdhci: fix minimum clock rate for v3 controller
	Documentation: Document arm64 kpti control
	Input: pm8xxx-vib - fix handling of separate enable register
	Input: sur40 - fix interface sanity checks
	Input: gtco - fix endpoint sanity check
	Input: aiptek - fix endpoint sanity check
	Input: pegasus_notetaker - fix endpoint sanity check
	Input: sun4i-ts - add a check for devm_thermal_zone_of_sensor_register
	hwmon: (nct7802) Fix voltage limits to wrong registers
	scsi: RDMA/isert: Fix a recently introduced regression related to logout
	tracing: xen: Ordered comparison of function pointers
	do_last(): fetch directory ->i_mode and ->i_uid before it's too late
	sd: Fix REQ_OP_ZONE_REPORT completion handling
	coresight: etb10: Do not call smp_processor_id from preemptible
	coresight: tmc-etf: Do not call smp_processor_id from preemptible
	libertas: Fix two buffer overflows at parsing bss descriptor
	media: v4l2-ioctl.c: zero reserved fields for S/TRY_FMT
	scsi: iscsi: Avoid potential deadlock in iscsi_if_rx func
	md: Avoid namespace collision with bitmap API
	bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free()
	netfilter: ipset: use bitmap infrastructure completely
	net/x25: fix nonblocking connect
	Linux 4.14.169

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: Idfe88b4d68180df412c1dbadd8402cb0353f0ecf
parents 641dfeb6 9fa690a2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1854,6 +1854,12 @@
			Built with CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y,
			the default is off.

	kpti=		[ARM64] Control page table isolation of user
			and kernel address spaces.
			Default: enabled on cores which need mitigation.
			0: force disabled
			1: force enabled

	kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs.
			Default is 0 (don't ignore, but inject #GP)

+1 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 168
SUBLEVEL = 169
EXTRAVERSION =
NAME = Petit Gorille

+3 −0
Original line number Diff line number Diff line
@@ -927,6 +927,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
			}
			if (!to) {
				printk ("No more free channels for FS50..\n");
				kfree(vcc);
				return -EBUSY;
			}
			vcc->channo = dev->channo;
@@ -937,6 +938,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
			if (((DO_DIRECTION(rxtp) && dev->atm_vccs[vcc->channo])) ||
			    ( DO_DIRECTION(txtp) && test_bit (vcc->channo, dev->tx_inuse))) {
				printk ("Channel is in use for FS155.\n");
				kfree(vcc);
				return -EBUSY;
			}
		}
@@ -950,6 +952,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
			    tc, sizeof (struct fs_transmit_config));
		if (!tc) {
			fs_dprintk (FS_DEBUG_OPEN, "fs: can't alloc transmit_config.\n");
			kfree(vcc);
			return -ENOMEM;
		}

+3 −2
Original line number Diff line number Diff line
@@ -297,9 +297,10 @@ static inline u16 volt2reg(int channel, long volt, u8 bypass_attn)
	long reg;

	if (bypass_attn & (1 << channel))
		reg = (volt * 1024) / 2250;
		reg = DIV_ROUND_CLOSEST(volt * 1024, 2250);
	else
		reg = (volt * r[1] * 1024) / ((r[0] + r[1]) * 2250);
		reg = DIV_ROUND_CLOSEST(volt * r[1] * 1024,
					(r[0] + r[1]) * 2250);
	return clamp_val(reg, 0, 1023) & (0xff << 2);
}

+55 −28
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ struct hwmon_device_attribute {

#define to_hwmon_attr(d) \
	container_of(d, struct hwmon_device_attribute, dev_attr)
#define to_dev_attr(a) container_of(a, struct device_attribute, attr)

/*
 * Thermal zone information
@@ -58,7 +59,7 @@ struct hwmon_device_attribute {
 * also provides the sensor index.
 */
struct hwmon_thermal_data {
	struct hwmon_device *hwdev;	/* Reference to hwmon device */
	struct device *dev;		/* Reference to hwmon device */
	int index;			/* sensor index */
};

@@ -95,9 +96,27 @@ static const struct attribute_group *hwmon_dev_attr_groups[] = {
	NULL
};

static void hwmon_free_attrs(struct attribute **attrs)
{
	int i;

	for (i = 0; attrs[i]; i++) {
		struct device_attribute *dattr = to_dev_attr(attrs[i]);
		struct hwmon_device_attribute *hattr = to_hwmon_attr(dattr);

		kfree(hattr);
	}
	kfree(attrs);
}

static void hwmon_dev_release(struct device *dev)
{
	kfree(to_hwmon_device(dev));
	struct hwmon_device *hwdev = to_hwmon_device(dev);

	if (hwdev->group.attrs)
		hwmon_free_attrs(hwdev->group.attrs);
	kfree(hwdev->groups);
	kfree(hwdev);
}

static struct class hwmon_class = {
@@ -121,11 +140,11 @@ static DEFINE_IDA(hwmon_ida);
static int hwmon_thermal_get_temp(void *data, int *temp)
{
	struct hwmon_thermal_data *tdata = data;
	struct hwmon_device *hwdev = tdata->hwdev;
	struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
	int ret;
	long t;

	ret = hwdev->chip->ops->read(&hwdev->dev, hwmon_temp, hwmon_temp_input,
	ret = hwdev->chip->ops->read(tdata->dev, hwmon_temp, hwmon_temp_input,
				     tdata->index, &t);
	if (ret < 0)
		return ret;
@@ -139,26 +158,31 @@ static const struct thermal_zone_of_device_ops hwmon_thermal_ops = {
	.get_temp = hwmon_thermal_get_temp,
};

static int hwmon_thermal_add_sensor(struct device *dev,
				    struct hwmon_device *hwdev, int index)
static int hwmon_thermal_add_sensor(struct device *dev, int index)
{
	struct hwmon_thermal_data *tdata;
	struct thermal_zone_device *tzd;

	tdata = devm_kzalloc(dev, sizeof(*tdata), GFP_KERNEL);
	if (!tdata)
		return -ENOMEM;

	tdata->hwdev = hwdev;
	tdata->dev = dev;
	tdata->index = index;

	devm_thermal_zone_of_sensor_register(&hwdev->dev, index, tdata,
	tzd = devm_thermal_zone_of_sensor_register(dev, index, tdata,
						   &hwmon_thermal_ops);
	/*
	 * If CONFIG_THERMAL_OF is disabled, this returns -ENODEV,
	 * so ignore that error but forward any other error.
	 */
	if (IS_ERR(tzd) && (PTR_ERR(tzd) != -ENODEV))
		return PTR_ERR(tzd);

	return 0;
}
#else
static int hwmon_thermal_add_sensor(struct device *dev,
				    struct hwmon_device *hwdev, int index)
static int hwmon_thermal_add_sensor(struct device *dev, int index)
{
	return 0;
}
@@ -235,8 +259,7 @@ static bool is_string_attr(enum hwmon_sensor_types type, u32 attr)
	       (type == hwmon_fan && attr == hwmon_fan_label);
}

static struct attribute *hwmon_genattr(struct device *dev,
				       const void *drvdata,
static struct attribute *hwmon_genattr(const void *drvdata,
				       enum hwmon_sensor_types type,
				       u32 attr,
				       int index,
@@ -264,7 +287,7 @@ static struct attribute *hwmon_genattr(struct device *dev,
	if ((mode & S_IWUGO) && !ops->write)
		return ERR_PTR(-EINVAL);

	hattr = devm_kzalloc(dev, sizeof(*hattr), GFP_KERNEL);
	hattr = kzalloc(sizeof(*hattr), GFP_KERNEL);
	if (!hattr)
		return ERR_PTR(-ENOMEM);

@@ -467,8 +490,7 @@ static int hwmon_num_channel_attrs(const struct hwmon_channel_info *info)
	return n;
}

static int hwmon_genattrs(struct device *dev,
			  const void *drvdata,
static int hwmon_genattrs(const void *drvdata,
			  struct attribute **attrs,
			  const struct hwmon_ops *ops,
			  const struct hwmon_channel_info *info)
@@ -494,7 +516,7 @@ static int hwmon_genattrs(struct device *dev,
			attr_mask &= ~BIT(attr);
			if (attr >= template_size)
				return -EINVAL;
			a = hwmon_genattr(dev, drvdata, info->type, attr, i,
			a = hwmon_genattr(drvdata, info->type, attr, i,
					  templates[attr], ops);
			if (IS_ERR(a)) {
				if (PTR_ERR(a) != -ENOENT)
@@ -508,8 +530,7 @@ static int hwmon_genattrs(struct device *dev,
}

static struct attribute **
__hwmon_create_attrs(struct device *dev, const void *drvdata,
		     const struct hwmon_chip_info *chip)
__hwmon_create_attrs(const void *drvdata, const struct hwmon_chip_info *chip)
{
	int ret, i, aindex = 0, nattrs = 0;
	struct attribute **attrs;
@@ -520,15 +541,17 @@ __hwmon_create_attrs(struct device *dev, const void *drvdata,
	if (nattrs == 0)
		return ERR_PTR(-EINVAL);

	attrs = devm_kcalloc(dev, nattrs + 1, sizeof(*attrs), GFP_KERNEL);
	attrs = kcalloc(nattrs + 1, sizeof(*attrs), GFP_KERNEL);
	if (!attrs)
		return ERR_PTR(-ENOMEM);

	for (i = 0; chip->info[i]; i++) {
		ret = hwmon_genattrs(dev, drvdata, &attrs[aindex], chip->ops,
		ret = hwmon_genattrs(drvdata, &attrs[aindex], chip->ops,
				     chip->info[i]);
		if (ret < 0)
		if (ret < 0) {
			hwmon_free_attrs(attrs);
			return ERR_PTR(ret);
		}
		aindex += ret;
	}

@@ -570,14 +593,13 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
			for (i = 0; groups[i]; i++)
				ngroups++;

		hwdev->groups = devm_kcalloc(dev, ngroups, sizeof(*groups),
					     GFP_KERNEL);
		hwdev->groups = kcalloc(ngroups, sizeof(*groups), GFP_KERNEL);
		if (!hwdev->groups) {
			err = -ENOMEM;
			goto free_hwmon;
		}

		attrs = __hwmon_create_attrs(dev, drvdata, chip);
		attrs = __hwmon_create_attrs(drvdata, chip);
		if (IS_ERR(attrs)) {
			err = PTR_ERR(attrs);
			goto free_hwmon;
@@ -621,8 +643,13 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
				if (!chip->ops->is_visible(drvdata, hwmon_temp,
							   hwmon_temp_input, j))
					continue;
				if (info[i]->config[j] & HWMON_T_INPUT)
					hwmon_thermal_add_sensor(dev, hwdev, j);
				if (info[i]->config[j] & HWMON_T_INPUT) {
					err = hwmon_thermal_add_sensor(hdev, j);
					if (err) {
						device_unregister(hdev);
						goto ida_remove;
					}
				}
			}
		}
	}
@@ -630,7 +657,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
	return hdev;

free_hwmon:
	kfree(hwdev);
	hwmon_dev_release(hdev);
ida_remove:
	ida_simple_remove(&hwmon_ida, id);
	return ERR_PTR(err);
Loading