Reported-by: Coverity Scan
CID
1374802 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking attr suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
void lttng_channel_set_default_attr(struct lttng_domain *domain,
struct lttng_channel_attr *attr)
{
- struct lttng_channel_extended *extended =
- (struct lttng_channel_extended *) attr->extended.ptr;
+ struct lttng_channel_extended *extended;
/* Safety check */
if (attr == NULL || domain == NULL) {
return;
}
+ extended = (struct lttng_channel_extended *) attr->extended.ptr;
memset(attr, 0, sizeof(struct lttng_channel_attr));
/* Same for all domains. */