Skip to contentSkip to conversation

sparc64: vcc: Fix error return code in vcc_probe()

PATCH Superseded Wei Yongjun 3 participants 5 messages Apr 27, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc64: vcc: Fix error return code in vcc_probe()

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/tty/vcc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/vcc.c +1 -0
index d2a1e1228c82..9ffd42e333b8 100644
@@ -605,6 +605,7 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	port->index = vcc_table_add(port);
 	if (port->index = -1) {
 		pr_err("VCC: no more TTY indices left for allocation\n");
+		rv = -ENOMEM;
 		goto free_ldc;
 	}
#1 lore raw
Quoted 7 lines · Wei Yongjun

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/tty/vcc.c | 1 +
 1 file changed, 1 insertion(+)

Why is sparc64 in your subject line?

confused,

greg k-h

#2 lore raw
In reply to Wei Yongjun

DQo+IE9uIE1vbiwgQXByIDI3LCAyMDIwIGF0IDEyOjI0OjE1UE0gKzAwMDAsIFdlaSBZb25nanVu IHdyb3RlOg0KPiA+IEZpeCB0byByZXR1cm4gbmVnYXRpdmUgZXJyb3IgY29kZSAtRU5PTUVNIGZy b20gdGhlIGVycm9yIGhhbmRsaW5nIGNhc2UNCj4gPiBpbnN0ZWFkIG9mIDAsIGFzIGRvbmUgZWxz ZXdoZXJlIGluIHRoaXMgZnVuY3Rpb24uDQo+ID4NCj4gPiBTaWduZWQtb2ZmLWJ5OiBXZWkgWW9u Z2p1biA8d2VpeW9uZ2p1bjFAaHVhd2VpLmNvbT4NCj4gPiAtLS0NCj4gPiAgZHJpdmVycy90dHkv dmNjLmMgfCAxICsNCj4gPiAgMSBmaWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspDQo+IA0KPiBX aHkgaXMgc3BhcmM2NCBpbiB5b3VyIHN1YmplY3QgbGluZT8NCj4gDQo+IGNvbmZ1c2VkLA0KPiAN Cg0KSSBnb3QgJ3NwYXJjNjSjunZjYzonIGZyb20gZ2l0IGxvZyAsd2lsbCBjaGFuZ2UgdG8gJ3R0 eTogdmNjJywgdGhhbmtzLg0KDQpSZWdhcmRzDQo

maintainer
#3 lore raw
In reply to Wei Yongjun

From: Greg Kroah-Hartman <[email protected]>
Date: Mon, 27 Apr 2020 14:27:47 +0200

Quoted 10 lines · Wei Yongjun
Quoted 7 lines

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/tty/vcc.c | 1 +
 1 file changed, 1 insertion(+)

Why is sparc64 in your subject line?

It's a sparc64 hypervisor console driver.

maintainer
#4 lore raw
In reply to Wei Yongjun
Quoted 7 lines · David Miller

From: Greg Kroah-Hartman <[email protected]>
Date: Mon, 27 Apr 2020 14:27:47 +0200

Quoted 4 lines · Wei Yongjun
Quoted 3 lines

Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
---
 drivers/tty/vcc.c | 1 +
 1 file changed, 1 insertion(+)

Why is sparc64 in your subject line?

It's a sparc64 hypervisor console driver.

Ah, that wasn't very obvious, sorry about that.

greg k-h