All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string
@ 2019-04-28 11:28 Alexander Couzens
  2019-04-28 11:28 ` [PATCH 2/2] qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty Alexander Couzens
  2019-04-28 15:14 ` [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Couzens @ 2019-04-28 11:28 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

---
 src/gprs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gprs.c b/src/gprs.c
index 148cbc979dfb..5f66cad591c1 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -1700,7 +1700,7 @@ static void netreg_status_changed(int status, int lac, int ci, int tech,
 {
 	struct ofono_gprs *gprs = data;
 
-	DBG("%d", status);
+	DBG("%d (%s)", status, registration_status_to_string(status));
 
 	gprs->netreg_status = status;
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty
  2019-04-28 11:28 [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Alexander Couzens
@ 2019-04-28 11:28 ` Alexander Couzens
  2019-04-28 15:14 ` [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Couzens @ 2019-04-28 11:28 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]

The message can be emitted without the fields being present. In this case ber or rssi are 0
resulting in a null pointer deref.
---
 drivers/qmimodem/netmon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/qmimodem/netmon.c b/drivers/qmimodem/netmon.c
index 14a55632e8a6..729879ce73d8 100644
--- a/drivers/qmimodem/netmon.c
+++ b/drivers/qmimodem/netmon.c
@@ -89,8 +89,8 @@ static void get_rssi_cb(struct qmi_result *result, void *user_data)
 
 	/* RSSI */
 	rssi = qmi_result_get(result, 0x11, &len);
-	num = GUINT16_FROM_LE(rssi->count);
 	if (rssi) {
+		num = GUINT16_FROM_LE(rssi->count);
 		for (i = 0; i < num; i++) {
 			DBG("RSSI: %hhu on RAT %hhd",
 				rssi->info[i].rssi,
@@ -126,8 +126,8 @@ static void get_rssi_cb(struct qmi_result *result, void *user_data)
 
 	/* Bit error rate */
 	ber = qmi_result_get(result, 0x15, &len);
-	num = GUINT16_FROM_LE(ber->count);
 	if (ber) {
+		num = GUINT16_FROM_LE(ber->count);
 		for (i = 0; i < ber->count; i++) {
 			DBG("Bit error rate: %hu on RAT %hhd",
 				GUINT16_FROM_LE(ber->info[i].rate),
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string
  2019-04-28 11:28 [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Alexander Couzens
  2019-04-28 11:28 ` [PATCH 2/2] qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty Alexander Couzens
@ 2019-04-28 15:14 ` Denis Kenzior
  1 sibling, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2019-04-28 15:14 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

Hi Alexander,

On 04/28/2019 06:28 AM, Alexander Couzens wrote:
> ---
>   src/gprs.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-28 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-28 11:28 [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Alexander Couzens
2019-04-28 11:28 ` [PATCH 2/2] qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty Alexander Couzens
2019-04-28 15:14 ` [PATCH 1/2] gprs: netreg_status_changed: output the status as human readable string Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.