[bug report] binder: Support multiple /dev instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Martijn Coenen,

The patch ac4812c5ffbb: "binder: Support multiple /dev instances"
from Feb 3, 2017, leads to the following static checker warning:

	drivers/android/binder.c:4266 binder_init()
	warn: did you mean to pass the address of 'device_names'

drivers/android/binder.c
  4255          /*
  4256           * Copy the module_parameter string, because we don't want to
  4257           * tokenize it in-place.
  4258           */
  4259          device_names = kzalloc(strlen(binder_devices_param) + 1, GFP_KERNEL);
  4260          if (!device_names) {
  4261                  ret = -ENOMEM;
  4262                  goto err_alloc_device_names_failed;
  4263          }
  4264          strcpy(device_names, binder_devices_param);
  4265  
  4266          while ((device_name = strsep(&device_names, ","))) {

Obviously we did mean to pass the address, but on of the problems with
this is that now we can't free "device_names" because we don't have the
original pointer stored anywhere.

  4267                  ret = init_binder_device(device_name);
  4268                  if (ret)
  4269                          goto err_init_binder_device_failed;
  4270          }
  4271  
  4272          return ret;
  4273  
  4274  err_init_binder_device_failed:
  4275          hlist_for_each_entry_safe(device, tmp, &binder_devices, hlist) {
  4276                  misc_deregister(&device->miscdev);
  4277                  hlist_del(&device->hlist);
  4278                  kfree(device);
  4279          }
  4280  err_alloc_device_names_failed:
  4281          debugfs_remove_recursive(binder_debugfs_dir_entry_root);
  4282  
  4283          return ret;
  4284  }

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux