Skip to content

Commit 1f63d1a

Browse files
committed
Merge tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small char/misc and other driver fixes for 6.1-rc6 to resolve some reported problems. Included in here are: - iio driver fixes - binder driver fix - nvmem driver fix - vme_vmci information leak fix - parport fix - slimbus configuration fix - coreboot firmware bugfix - speakup build fix and crash fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (22 commits) firmware: coreboot: Register bus in module init nvmem: u-boot-env: fix crc32_data_offset on redundant u-boot-env slimbus: qcom-ngd: Fix build error when CONFIG_SLIM_QCOM_NGD_CTRL=y && CONFIG_QCOM_RPROC_COMMON=m docs: update mediator contact information in CoC doc slimbus: stream: correct presence rate frequencies nvmem: lan9662-otp: Fix compatible string binder: validate alloc->mm in ->mmap() handler parport_pc: Avoid FIFO port location truncation siox: fix possible memory leak in siox_device_add() misc/vmw_vmci: fix an infoleak in vmci_host_do_receive_datagram() speakup: replace utils' u_char with unsigned char speakup: fix a segfault caused by switching consoles tools: iio: iio_generic_buffer: Fix read size iio: imu: bno055: uninitialized variable bug in bno055_trigger_handler() iio: adc: at91_adc: fix possible memory leak in at91_adc_allocate_trigger() iio: adc: mp2629: fix potential array out of bound access iio: adc: mp2629: fix wrong comparison of channel iio: pressure: ms5611: changed hardcoded SPI speed to value limited iio: pressure: ms5611: fixed value compensation bug iio: accel: bma400: Ensure VDDIO is enable defore reading the chip ID. ...
2 parents ae55826 + 6594669 commit 1f63d1a

File tree

22 files changed

+111
-75
lines changed

22 files changed

+111
-75
lines changed

Documentation/process/code-of-conduct-interpretation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're
5151
uncertain how to handle situations that come up. It will not be
5252
considered a violation report unless you want it to be. If you are
5353
uncertain about approaching the TAB or any other maintainers, please
54-
reach out to our conflict mediator, Joanna Lee <[email protected]>.
54+
reach out to our conflict mediator, Joanna Lee <[email protected]>.
5555

5656
In the end, "be kind to each other" is really what the end goal is for
5757
everybody. We know everyone is human and we all fail at times, but the

drivers/accessibility/speakup/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1778,7 +1778,7 @@ static void speakup_con_update(struct vc_data *vc)
17781778
{
17791779
unsigned long flags;
17801780

1781-
if (!speakup_console[vc->vc_num] || spk_parked)
1781+
if (!speakup_console[vc->vc_num] || spk_parked || !synth)
17821782
return;
17831783
if (!spin_trylock_irqsave(&speakup_info.spinlock, flags))
17841784
/* Speakup output, discard */

drivers/accessibility/speakup/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static inline int oops(const char *msg, const char *info)
5454

5555
static inline struct st_key *hash_name(char *name)
5656
{
57-
u_char *pn = (u_char *)name;
57+
unsigned char *pn = (unsigned char *)name;
5858
int hash = 0;
5959

6060
while (*pn) {

drivers/android/binder_alloc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,12 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
739739
const char *failure_string;
740740
struct binder_buffer *buffer;
741741

742+
if (unlikely(vma->vm_mm != alloc->mm)) {
743+
ret = -EINVAL;
744+
failure_string = "invalid vma->vm_mm";
745+
goto err_invalid_mm;
746+
}
747+
742748
mutex_lock(&binder_alloc_mmap_lock);
743749
if (alloc->buffer_size) {
744750
ret = -EBUSY;
@@ -785,6 +791,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc,
785791
alloc->buffer_size = 0;
786792
err_already_mapped:
787793
mutex_unlock(&binder_alloc_mmap_lock);
794+
err_invalid_mm:
788795
binder_alloc_debug(BINDER_DEBUG_USER_ERROR,
789796
"%s: %d %lx-%lx %s failed %d\n", __func__,
790797
alloc->pid, vma->vm_start, vma->vm_end,

drivers/firmware/google/coreboot_table.c

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,8 @@ static int coreboot_table_probe(struct platform_device *pdev)
149149
if (!ptr)
150150
return -ENOMEM;
151151

152-
ret = bus_register(&coreboot_bus_type);
153-
if (!ret) {
154-
ret = coreboot_table_populate(dev, ptr);
155-
if (ret)
156-
bus_unregister(&coreboot_bus_type);
157-
}
152+
ret = coreboot_table_populate(dev, ptr);
153+
158154
memunmap(ptr);
159155

160156
return ret;
@@ -169,7 +165,6 @@ static int __cb_dev_unregister(struct device *dev, void *dummy)
169165
static int coreboot_table_remove(struct platform_device *pdev)
170166
{
171167
bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister);
172-
bus_unregister(&coreboot_bus_type);
173168
return 0;
174169
}
175170

@@ -199,6 +194,32 @@ static struct platform_driver coreboot_table_driver = {
199194
.of_match_table = of_match_ptr(coreboot_of_match),
200195
},
201196
};
202-
module_platform_driver(coreboot_table_driver);
197+
198+
static int __init coreboot_table_driver_init(void)
199+
{
200+
int ret;
201+
202+
ret = bus_register(&coreboot_bus_type);
203+
if (ret)
204+
return ret;
205+
206+
ret = platform_driver_register(&coreboot_table_driver);
207+
if (ret) {
208+
bus_unregister(&coreboot_bus_type);
209+
return ret;
210+
}
211+
212+
return 0;
213+
}
214+
215+
static void __exit coreboot_table_driver_exit(void)
216+
{
217+
platform_driver_unregister(&coreboot_table_driver);
218+
bus_unregister(&coreboot_bus_type);
219+
}
220+
221+
module_init(coreboot_table_driver_init);
222+
module_exit(coreboot_table_driver_exit);
223+
203224
MODULE_AUTHOR("Google, Inc.");
204225
MODULE_LICENSE("GPL");

drivers/iio/accel/bma400_core.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -869,18 +869,6 @@ static int bma400_init(struct bma400_data *data)
869869
unsigned int val;
870870
int ret;
871871

872-
/* Try to read chip_id register. It must return 0x90. */
873-
ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val);
874-
if (ret) {
875-
dev_err(data->dev, "Failed to read chip id register\n");
876-
return ret;
877-
}
878-
879-
if (val != BMA400_ID_REG_VAL) {
880-
dev_err(data->dev, "Chip ID mismatch\n");
881-
return -ENODEV;
882-
}
883-
884872
data->regulators[BMA400_VDD_REGULATOR].supply = "vdd";
885873
data->regulators[BMA400_VDDIO_REGULATOR].supply = "vddio";
886874
ret = devm_regulator_bulk_get(data->dev,
@@ -906,6 +894,18 @@ static int bma400_init(struct bma400_data *data)
906894
if (ret)
907895
return ret;
908896

897+
/* Try to read chip_id register. It must return 0x90. */
898+
ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val);
899+
if (ret) {
900+
dev_err(data->dev, "Failed to read chip id register\n");
901+
return ret;
902+
}
903+
904+
if (val != BMA400_ID_REG_VAL) {
905+
dev_err(data->dev, "Chip ID mismatch\n");
906+
return -ENODEV;
907+
}
908+
909909
ret = bma400_get_power_mode(data);
910910
if (ret) {
911911
dev_err(data->dev, "Failed to get the initial power-mode\n");

drivers/iio/adc/at91-sama5d2_adc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,11 +2307,9 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st,
23072307
clb->p6 = buf[AT91_ADC_TS_CLB_IDX_P6];
23082308

23092309
/*
2310-
* We prepare here the conversion to milli and also add constant
2311-
* factor (5 degrees Celsius) to p1 here to avoid doing it on
2312-
* hotpath.
2310+
* We prepare here the conversion to milli to avoid doing it on hotpath.
23132311
*/
2314-
clb->p1 = clb->p1 * 1000 + 5000;
2312+
clb->p1 = clb->p1 * 1000;
23152313

23162314
free_buf:
23172315
kfree(buf);

drivers/iio/adc/at91_adc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,10 @@ static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *idev,
634634
trig->ops = &at91_adc_trigger_ops;
635635

636636
ret = iio_trigger_register(trig);
637-
if (ret)
637+
if (ret) {
638+
iio_trigger_free(trig);
638639
return NULL;
640+
}
639641

640642
return trig;
641643
}

drivers/iio/adc/mp2629_adc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ static struct iio_map mp2629_adc_maps[] = {
5757
MP2629_MAP(SYSTEM_VOLT, "system-volt"),
5858
MP2629_MAP(INPUT_VOLT, "input-volt"),
5959
MP2629_MAP(BATT_CURRENT, "batt-current"),
60-
MP2629_MAP(INPUT_CURRENT, "input-current")
60+
MP2629_MAP(INPUT_CURRENT, "input-current"),
61+
{ }
6162
};
6263

6364
static int mp2629_read_raw(struct iio_dev *indio_dev,
@@ -74,7 +75,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev,
7475
if (ret)
7576
return ret;
7677

77-
if (chan->address == MP2629_INPUT_VOLT)
78+
if (chan->channel == MP2629_INPUT_VOLT)
7879
rval &= GENMASK(6, 0);
7980
*val = rval;
8081
return IIO_VAL_INT;

drivers/iio/imu/bno055/bno055.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static int bno055_set_regmask(struct bno055_priv *priv, int val, int val2,
632632
return -EINVAL;
633633
}
634634
delta = abs(tbl_val - req_val);
635-
if (delta < best_delta || first) {
635+
if (first || delta < best_delta) {
636636
best_delta = delta;
637637
hwval = i;
638638
first = false;

0 commit comments

Comments
 (0)