Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'linux-4.7' of git://github.com/skeggsb/linux into drm-fixes

* 'linux-4.7' of git://github.com/skeggsb/linux:
drm/nouveau/iccsense: fix memory leak
drm/nouveau/Revert "drm/nouveau/device/pci: set as non-CPU-coherent on ARM64"

+10 -8
+1 -1
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
··· 1614 1614 .fini = nvkm_device_pci_fini, 1615 1615 .resource_addr = nvkm_device_pci_resource_addr, 1616 1616 .resource_size = nvkm_device_pci_resource_size, 1617 - .cpu_coherent = !IS_ENABLED(CONFIG_ARM) && !IS_ENABLED(CONFIG_ARM64), 1617 + .cpu_coherent = !IS_ENABLED(CONFIG_ARM), 1618 1618 }; 1619 1619 1620 1620 int
+9 -7
drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/base.c
··· 276 276 struct pwr_rail_t *r = &stbl.rail[i]; 277 277 struct nvkm_iccsense_rail *rail; 278 278 struct nvkm_iccsense_sensor *sensor; 279 + int (*read)(struct nvkm_iccsense *, 280 + struct nvkm_iccsense_rail *); 279 281 280 282 if (!r->mode || r->resistor_mohm == 0) 281 283 continue; ··· 286 284 if (!sensor) 287 285 continue; 288 286 289 - rail = kmalloc(sizeof(*rail), GFP_KERNEL); 290 - if (!rail) 291 - return -ENOMEM; 292 - 293 287 switch (sensor->type) { 294 288 case NVBIOS_EXTDEV_INA209: 295 289 if (r->rail != 0) 296 290 continue; 297 - rail->read = nvkm_iccsense_ina209_read; 291 + read = nvkm_iccsense_ina209_read; 298 292 break; 299 293 case NVBIOS_EXTDEV_INA219: 300 294 if (r->rail != 0) 301 295 continue; 302 - rail->read = nvkm_iccsense_ina219_read; 296 + read = nvkm_iccsense_ina219_read; 303 297 break; 304 298 case NVBIOS_EXTDEV_INA3221: 305 299 if (r->rail >= 3) 306 300 continue; 307 - rail->read = nvkm_iccsense_ina3221_read; 301 + read = nvkm_iccsense_ina3221_read; 308 302 break; 309 303 default: 310 304 continue; 311 305 } 312 306 307 + rail = kmalloc(sizeof(*rail), GFP_KERNEL); 308 + if (!rail) 309 + return -ENOMEM; 313 310 sensor->rail_mask |= 1 << r->rail; 311 + rail->read = read; 314 312 rail->sensor = sensor; 315 313 rail->idx = r->rail; 316 314 rail->mohm = r->resistor_mohm;