[Asterisk-code-review] chan dahdi: check result of ast channel tech pvt (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Wed Mar 1 17:34:45 CST 2017


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/5113 )

Change subject: chan_dahdi: check result of ast_channel_tech_pvt
......................................................................


Patch Set 1: Code-Review-1

(6 comments)

An important question is why did jenkins verify this?

https://gerrit.asterisk.org/#/c/5113/1/channels/chan_dahdi.c
File channels/chan_dahdi.c:

PS1, Line 6395: 	struct dahdi_pvt *p = ast_channel_tech_pvt(ast);
              : 	if (!p) {
              : 		errno = EINVAL;
              : 		return -1;
              : 	}
              : 	int res = 0;
              : 	int idx;
No mixing of declarations and code.


PS1, Line 7047: 	struct dahdi_pvt *p = ast_channel_tech_pvt(newchan);
              : 	if (!p) {
              : 		ast_debug(1, "Unable to find technology private\n");
              : 		return 0;
              : 	}
              : 	int x;
more mixing.


PS1, Line 7221: 	struct dahdi_pvt *p = ast_channel_tech_pvt(ast);
              : 	if (!p) {
              : 		ast_debug(1, "Unable to find technology private\n");
              : 		return;
              : 	}
              : 	struct ast_frame *f = *dest;
Same here.


PS1, Line 7384: 	if (!p) {
              : 		ast_debug(1, "Unable to find technology private\n");
              : 		return &ast_null_frame;
              : 	}
Another.


PS1, Line 8397: 	struct dahdi_pvt *p = ast_channel_tech_pvt(ast);
              : 	if (!p) {
              : 		ast_debug(1, "Unable to find technology private\n");
              : 		return NULL;
              : 	}
              : 	struct ast_frame *f;
More mixing.


PS1, Line 19701: 	struct dahdi_pvt *p = ast_channel_tech_pvt(c);
               : 	if (!p) {
               : 		ast_debug(1, "Unable to find technology private\n");
               : 		return -1;
               : 	}
               : 	struct pollfd fds[1];
One last one.


-- 
To view, visit https://gerrit.asterisk.org/5113
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5f3d37f15de9433f742558c6142f862d63d47ac
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list